Unit.cs 700 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using UnityEngine;
  2. using Quaternion = UnityEngine.Quaternion;
  3. using Vector3 = UnityEngine.Vector3;
  4. namespace ET
  5. {
  6. public sealed class Unit: Entity
  7. {
  8. // 先放这里,去掉ViewGO,后面挪到显示层
  9. public GameObject GameObject;
  10. public int ConfigId;
  11. public UnitConfig Config
  12. {
  13. get
  14. {
  15. return UnitConfigCategory.Instance.Get(this.ConfigId);
  16. }
  17. }
  18. public Vector3 Position
  19. {
  20. get
  21. {
  22. return GameObject.transform.position;
  23. }
  24. set
  25. {
  26. GameObject.transform.position = value;
  27. }
  28. }
  29. public Quaternion Rotation
  30. {
  31. get
  32. {
  33. return GameObject.transform.rotation;
  34. }
  35. set
  36. {
  37. GameObject.transform.rotation = value;
  38. }
  39. }
  40. }
  41. }