Unit.cs 696 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using UnityEngine;
  2. namespace Model
  3. {
  4. public enum UnitType
  5. {
  6. Hero,
  7. Npc
  8. }
  9. [ObjectEvent]
  10. public class UnitEvent : ObjectEvent<Unit>
  11. {
  12. }
  13. public sealed class Unit: Entity
  14. {
  15. public VInt3 IntPos;
  16. public GameObject GameObject;
  17. public void Awake()
  18. {
  19. }
  20. public Vector3 Position
  21. {
  22. get
  23. {
  24. return GameObject.transform.position;
  25. }
  26. set
  27. {
  28. GameObject.transform.position = value;
  29. }
  30. }
  31. public Quaternion Rotation
  32. {
  33. get
  34. {
  35. return GameObject.transform.rotation;
  36. }
  37. set
  38. {
  39. GameObject.transform.rotation = value;
  40. }
  41. }
  42. public override void Dispose()
  43. {
  44. if (this.Id == 0)
  45. {
  46. return;
  47. }
  48. base.Dispose();
  49. }
  50. }
  51. }