using UnityEngine; namespace ET { [EntitySystemOf(typeof(GlobalComponent))] public static partial class GlobalComponentSystem { [EntitySystem] public static void Awake(this GlobalComponent self) { self.Global = GameObject.Find("/Global").transform; self.Unit = GameObject.Find("/Global/Unit").transform; self.UI = GameObject.Find("/Global/UI").transform; self.GlobalConfig = Resources.Load("GlobalConfig"); } } [ComponentOf(typeof(Scene))] public class GlobalComponent: Entity, IAwake { public Transform Global; public Transform Unit { get; set; } public Transform UI; public GlobalConfig GlobalConfig { get; set; } } }