예제 #1
0
    /// <summary>
    /// 显示loading界面
    /// </summary>
    /// <param name="onReady">回调</param>
    /// <param name="showSplash">显示loading的Label</param>
    /// <param name="showDownloading">显示下载的Label</param>
    /// <param name="showBlock">显示蒙版,防止点击</param>
    /// <param name="showUpdateAsk">显示下载请求</param>
    /// <param name="showCloud">显示云</param>
    public void ShowLoadingScreen(System.Action onReady, bool showSplash = true, bool showBlock = false, bool showCloud = false)
    {
        _ShowLoadingScreen_CounterOnce++;

        if (IsLoadingScreenUp)
        {
            EB.Debug.Log("loading界面正在显示,新的回调立即执行!");
            onReady?.Invoke();
            return;
        }

        EB.Debug.Log("loading界面开始=====>");
        FusionAudio.StopMusic();
        FusionAudio.StopAmbience();

        if (null == UIHierarchyHelper.Instance)
        {
            EB.Debug.LogWarning("ShowLoadingScreen: UIHierarchyHelper is null");
            return;
        }

        if (!UIHierarchyHelper.Instance.gameObject.activeSelf)
        {
            EB.Debug.LogWarning("ShowLoadingScreen: UIHierarchyHelper is disabled");
            return;
        }

        ClearEnstackQueue();

        IsLoadingScreenUp = true;
        RemoveTimer();

        if (_loadingScreen == null)
        {
            UIHierarchyHelper.Instance.LoadAndPlaceAsync(go =>
            {
                _loadingScreen       = go;
                _loadingScreen_logic = go.GetComponent <LoadingLogic>();
                ShowLoadingScreen_AfterFunc(showSplash, showBlock, showCloud, onReady);
            }, loadingScreenPrefabPath, UIHierarchyHelper.eUIType.None, null, true);
        }
        else
        {
            ShowLoadingScreen_AfterFunc(showSplash, showBlock, showCloud, onReady);
        }
    }
예제 #2
0
        public override void End()
        {
            SparxHub.Instance.PushManager.OnScheduleLocalNotification -= ScheduleLocalNotification;
            SparxHub.Instance.ChatManager.OnConnected -= RegisterChatChannels;

            DestroyFlowControlObject();

            HudLoadManager.DestroyAllHud();
            SceneLoadManager.DestroyAllLevel();
            PlayerManagerForFilter.Dispose();
            NpcManager.Dispose();
            MainLandLogic.Dispose();
            CombatLogic.Dispose();
            InputBlockerManager.Instance.ForceUnlockAll();
            LoadingSpinner.Destroy();
            FusionAudio.StopMusic();
            FusionAudio.StopAmbience();
            ChatController.instance.Clean();
        }