Unit.cs 577 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using PF;
  2. using UnityEngine;
  3. namespace ETModel
  4. {
  5. public enum UnitType
  6. {
  7. Hero,
  8. Npc
  9. }
  10. [ObjectSystem]
  11. public class UnitAwakeSystem : AwakeSystem<Unit, UnitType>
  12. {
  13. public override void Awake(Unit self, UnitType a)
  14. {
  15. self.Awake(a);
  16. }
  17. }
  18. public sealed class Unit: Entity
  19. {
  20. public UnitType UnitType { get; private set; }
  21. public Vector3 Position { get; set; }
  22. public void Awake(UnitType unitType)
  23. {
  24. this.UnitType = unitType;
  25. }
  26. public override void Dispose()
  27. {
  28. if (this.IsDisposed)
  29. {
  30. return;
  31. }
  32. base.Dispose();
  33. }
  34. }
  35. }