protected override void ConfigComponents() { base.ConfigComponents(); #if UNITY_EDITOR enableOutlog = true; #else enableOutlog = true; #endif ComponentTools.AddComponent <AudioListener>(gameObject); if (Framework.Get <ResManager>() == null) { Framework.AddComponent <ResManager>(); } if (Framework.Get <AudioManager>() == null) { Framework.AddComponent <AudioManager>(); } #if UNITY_EDITOR #elif UNITY_IOS #elif UNITY_ANDROID #endif SMSceneManager sceneManager; sceneManager = AddComponent <SMSceneManager>(); sceneManager.TransitionPrefab = "Prefabs/SMTransitions/SMFadeTransition"; // sceneManager.SceneLoaded += OnSceneLoaded; }
// static GameObject uiRoot; void Awake() { //create game instance if (!Framework.HasInstance) { Framework instance = Framework.Instance; Framework.AddComponent <DataCenter>(); Framework.AddComponent <SceneManager>(); Framework.AddComponent <EffectManager>(); Framework.ScreenManager.AddScreen <MainMenu>(); Framework.ScreenManager.AddScreen <GamePlay>(); /* * uiRoot = GameObject.Find("UI Root (3D)"); * * if (uiRoot != null) * { * GameObject.DontDestroyOnLoad(uiRoot); * } * else * { * Debug.LogError("cannot find ui root object"); * } */ Framework.ScreenManager.ChangeScreen(typeof(MainMenu)); } }