Unit.cs 809 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 GameObject GameObject;
  19. public void Awake(GameObject gameObject)
  20. {
  21. this.GameObject = gameObject;
  22. }
  23. public Vector3 Position
  24. {
  25. get
  26. {
  27. return GameObject.transform.position;
  28. }
  29. set
  30. {
  31. GameObject.transform.position = value;
  32. }
  33. }
  34. public Quaternion Rotation
  35. {
  36. get
  37. {
  38. return GameObject.transform.rotation;
  39. }
  40. set
  41. {
  42. GameObject.transform.rotation = value;
  43. }
  44. }
  45. }
  46. }