MyClass.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. 
  2. using AtomicEngine;
  3. using System;
  4. namespace AtomicNETTest
  5. {
  6. public enum BehaviorState
  7. {
  8. Friendly,
  9. Aggressive,
  10. Neutral
  11. }
  12. public class Spinner : CSComponent
  13. {
  14. [Inspector]
  15. float speed = 1.0f;
  16. [Inspector]
  17. float pitchSpeed = 0.0f;
  18. public override void Update(float timeStep)
  19. {
  20. Node.Yaw(timeStep * speed * 75.0f);
  21. Node.Pitch(timeStep * pitchSpeed * 75.0f);
  22. //Console.WriteLine("TICK! : {0}", speed);
  23. }
  24. }
  25. public class MyComponent : CSComponent
  26. {
  27. public override void Update(float timeStep)
  28. {
  29. //Node.Yaw(timeStep * 75);
  30. }
  31. [Inspector]
  32. public bool MyBoolValue = true;
  33. [Inspector]
  34. public int MyIntValue = 5;
  35. [Inspector]
  36. public int MyOtherIntValue = 101;
  37. [Inspector]
  38. public Vector3 MyVector3Value = new Vector3(1, 1, 1);
  39. [Inspector]
  40. public Quaternion MyQuaternionValue = new Quaternion(1, 0, 0, 0);
  41. [Inspector()]
  42. public float MyFloatValue = 42.0f;
  43. [Inspector]
  44. public string MyStringValue = "Hey!";
  45. [Inspector]
  46. public BehaviorState State = BehaviorState.Neutral;
  47. [Inspector("Textures/chest.png")]
  48. public Sprite2D MySprite2DValue;
  49. [Inspector(DefaultValue = "Textures/chest.png")]
  50. public Sprite2D MyOtherSprite2DValue;
  51. }
  52. }