コード例 #1
0
        private void CreateLoadingScreen()
        {
            if (_loadingScreen != null)
            {
                return;
            }

            var go = ResourceLoader.LoadLoadingScreen();

            if (go == null)
            {
                Log.Error(MessageGroup.Gameplay, "Cant load loading screen prefab");
                return;
            }

            go = MainCanvasBehaviour.RegisterPanel(UIType.LoadingScreen, go);
            if (go == null)
            {
                return;
            }

            _loadingScreen = go.GetComponent <LoadingScreenBehaviour>();
            if (_loadingScreen == null)
            {
                Log.Error(MessageGroup.Gameplay, "Loading screen dont have behaviour");
            }

#if UNITY_EDITOR
            // Only for initialization of gameplay controller on first scene while testing.
            if (IsOnStage)
            {
                GameplayController.CreateGameplayControllerOnStageLoaded();
            }
#endif
        }
コード例 #2
0
        private void OnSceneLoaded()
        {
            if (_isLoadingStage)
            {
                GameplayController.CreateGameplayControllerOnStageLoaded();
                return;
            }

            LoadingScreen.HideLoadingScreen(OnLoadingScreenHided);
        }