Unit.cs 558 B

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