Unit.cs 546 B

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