GlobalComponent.cs 745 B

1234567891011121314151617181920212223242526
  1. using UnityEngine;
  2. namespace ET
  3. {
  4. [FriendOf(typeof(GlobalComponent))]
  5. public static partial class GlobalComponentSystem
  6. {
  7. [EntitySystem]
  8. public static void Awake(this GlobalComponent self)
  9. {
  10. self.Global = GameObject.Find("/Global").transform;
  11. self.Unit = GameObject.Find("/Global/Unit").transform;
  12. self.UI = GameObject.Find("/Global/UI").transform;
  13. self.GlobalConfig = Resources.Load<GlobalConfig>("GlobalConfig");
  14. }
  15. }
  16. public class GlobalComponent: Entity, IAwake
  17. {
  18. public Transform Global;
  19. public Transform Unit { get; set; }
  20. public Transform UI;
  21. public GlobalConfig GlobalConfig { get; set; }
  22. }
  23. }