Unit.cs 882 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using PF;
  2. using UnityEngine;
  3. using Quaternion = UnityEngine.Quaternion;
  4. using Vector3 = UnityEngine.Vector3;
  5. namespace ETModel
  6. {
  7. [ObjectSystem]
  8. public class UnitAwakeSystem : AwakeSystem<Unit, GameObject>
  9. {
  10. public override void Awake(Unit self, GameObject gameObject)
  11. {
  12. self.Awake(gameObject);
  13. }
  14. }
  15. [HideInHierarchy]
  16. public sealed class Unit: Entity
  17. {
  18. public void Awake(GameObject gameObject)
  19. {
  20. this.GameObject = gameObject;
  21. }
  22. public Vector3 Position
  23. {
  24. get
  25. {
  26. return GameObject.transform.position;
  27. }
  28. set
  29. {
  30. GameObject.transform.position = value;
  31. }
  32. }
  33. public Quaternion Rotation
  34. {
  35. get
  36. {
  37. return GameObject.transform.rotation;
  38. }
  39. set
  40. {
  41. GameObject.transform.rotation = value;
  42. }
  43. }
  44. public override void Dispose()
  45. {
  46. if (this.IsDisposed)
  47. {
  48. return;
  49. }
  50. base.Dispose();
  51. }
  52. }
  53. }