Program.cs 647 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using AtomicSharp;
  3. using Light = AtomicSharp.Light;
  4. using Node = AtomicSharp.Node;
  5. namespace AtomicSharpTest
  6. {
  7. class MainClass
  8. {
  9. static Node CreateNode() {
  10. return new AtomicSharp.Node ();
  11. }
  12. static void AddLight(Node node) {
  13. node.AddComponent (new Light (), 0, CreateMode.REPLICATED);
  14. }
  15. public static void Main (string[] args)
  16. {
  17. AtomicSharp.AtomicSharp.Initialize ();
  18. var node = CreateNode ();
  19. AddLight (node);
  20. node.Name = "MyNode";
  21. if (node.HasComponent("Light"))
  22. Console.Write (node.Name + " has a light");
  23. while (AtomicSharp.AtomicSharp.RunFrame ()) {
  24. }
  25. }
  26. }
  27. }