UnitSystem.cs 510 B

12345678910111213141516171819202122
  1. namespace ET
  2. {
  3. [EntitySystemOf(typeof(Unit))]
  4. public static partial class UnitSystem
  5. {
  6. [EntitySystem]
  7. private static void Awake(this Unit self, int configId)
  8. {
  9. self.ConfigId = configId;
  10. }
  11. public static UnitConfig Config(this Unit self)
  12. {
  13. return UnitConfigCategory.Instance.Get(self.ConfigId);
  14. }
  15. public static int Type(this Unit self)
  16. {
  17. return self.Config().Type;
  18. }
  19. }
  20. }