using UnityEngine; namespace ET { public class GameSceneManagerComponentAwakeSystem : AwakeSystem { public override void Awake(GameSceneManagerComponent self) { self.Awake(); } } public class GameSceneManagerComponentDestroySystem : DestroySystem { public override void Destroy(GameSceneManagerComponent self) { self.Destroy(); } } [FriendClass(typeof(GameSceneManagerComponent))] public static class GameSceneManagerComponentSystem { public static void Awake(this GameSceneManagerComponent self) { var sceneRoot = GameObject.Find("SceneRoot"); ReferenceCollector rc = sceneRoot.GetComponent(); self.SceneRoots.Add(rc.Get("MainSceneRoot")); self.SceneRoots.Add(rc.Get("BattleSceneRoot")); self.Hide(GameSceneType.Battle); } public static void Show(this GameSceneManagerComponent self, GameSceneType type) { self.SceneRoots[(int)type].SetActive(true); } public static void Hide(this GameSceneManagerComponent self, GameSceneType type) { self.SceneRoots[(int)type].SetActive(false); } public static GameObject GetRoot(this GameSceneManagerComponent self, GameSceneType type) { return self.SceneRoots[(int)type]; } public static void Destroy(this GameSceneManagerComponent self) { } } }