public void ShowLoading()
        {
            Singleton <BurnExpeditionController> .instance.Clear();

            MonoSingleton <ShareSys> .instance.m_bShowTimeline = false;
            Singleton <CUIManager> .GetInstance().CloseAllForm(null, true, true);

            Singleton <CUIManager> .GetInstance().ClearEventGraphicsData();

            if (Singleton <LobbyLogic> .instance.inMultiGame)
            {
                CUILoadingSystem.ShowMultiLoading();
            }
            else
            {
                SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                if (curLvelContext != null)
                {
                    if (curLvelContext.IsMobaModeWithOutGuide())
                    {
                        CUILoadingSystem.ShowMultiLoading();
                    }
                    else
                    {
                        this.ShowPveLoading();
                    }
                }
            }
        }
        public void HideLoading()
        {
            Singleton <CUIManager> .GetInstance().ClearEventGraphicsData();

            if (Singleton <LobbyLogic> .instance.inMultiGame)
            {
                CUILoadingSystem.HideMultiLoading();
            }
            else
            {
                SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                if (curLvelContext != null)
                {
                    if (curLvelContext.IsMobaModeWithOutGuide())
                    {
                        CUILoadingSystem.HideMultiLoading();
                    }
                    else
                    {
                        this.HidePveLoading();
                    }
                }
            }
        }
    private void OnHostPlayerHPChange()
    {
        int currentUTCTime = CRoleInfo.GetCurrentUTCTime();

        if (currentUTCTime - this.lastChangeTime < 2)
        {
            return;
        }
        this.lastChangeTime = currentUTCTime;
        Player hostPlayer = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer();

        if (hostPlayer == null || !hostPlayer.Captain || hostPlayer.Captain.get_handle().ActorControl == null || hostPlayer.Captain.get_handle().ValueComponent == null)
        {
            return;
        }
        int roundInt = (hostPlayer.Captain.get_handle().ValueComponent.GetHpRate() * 100L).get_roundInt();

        if (this.lastRate < roundInt)
        {
            this.lastRate = roundInt;
            return;
        }
        this.lastRate = roundInt;
        if (roundInt < 40)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            if (curLvelContext != null && curLvelContext.IsMobaModeWithOutGuide())
            {
                this.CheckTriggerTime(NewbieGuideTriggerTimeType.onHostPlayerLowHp, new uint[0]);
            }
        }
    }
        public static void OnSelfLoadProcess(float progress)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            if (curLvelContext != null)
            {
                if (curLvelContext.IsMobaModeWithOutGuide())
                {
                    Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                    if (hostPlayer != null)
                    {
                        GameObject memberItem = GetMemberItem(hostPlayer.PlayerId);
                        if (memberItem != null)
                        {
                            Transform transform = memberItem.transform.Find("Txt_LoadingPct");
                            if (transform != null)
                            {
                                transform.GetComponent <Text>().text = string.Format("{0}%", Convert.ToUInt16((float)(progress * 100f)));
                            }
                        }
                    }
                    if (curLvelContext.m_isWarmBattle)
                    {
                        CFakePvPHelper.FakeLoadProcess(progress);
                    }
                }
                else if (_singlePlayerLoading != null)
                {
                    _singlePlayerLoading.m_formWidgets[2].GetComponent <Text>().text = string.Format("{0}%", (int)(Mathf.Clamp(progress, 0f, 1f) * 100f));
                    _singlePlayerLoading.m_formWidgets[3].GetComponent <Image>().CustomFillAmount(Mathf.Clamp(progress, 0f, 1f));
                }
            }
        }
    private void OnHostPlayerHitByTower()
    {
        SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

        if (curLvelContext != null && curLvelContext.IsMobaModeWithOutGuide())
        {
            this.CheckTriggerTime(NewbieGuideTriggerTimeType.onHostPlayerHitByTower, new uint[0]);
        }
    }
        private void onFightStart(ref DefaultGameEventParam prm)
        {
            this.Clear();
            SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

            this.bActiveSys = curLvelContext.IsMobaModeWithOutGuide();
            if (!this.bActiveSys)
            {
                return;
            }
            this.StartupSys();
        }
Exemple #7
0
        public override void OnStateEnter()
        {
            this.m_originalBlendWeight = QualitySettings.blendWeights;
            if (GameSettings.RenderQuality == SGameRenderQuality.Low)
            {
                QualitySettings.blendWeights = BlendWeights.OneBone;
            }
            else
            {
                QualitySettings.blendWeights = BlendWeights.TwoBones;
            }
            SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

            string eventName = (curLvelContext == null || string.IsNullOrEmpty(curLvelContext.m_musicStartEvent)) ? "PVP01_Play" : curLvelContext.m_musicStartEvent;

            Singleton <CSoundManager> .GetInstance().PostEvent(eventName, null);

            string text = (curLvelContext == null) ? string.Empty : curLvelContext.m_ambientSoundEvent;

            if (!string.IsNullOrEmpty(text))
            {
                Singleton <CSoundManager> .get_instance().PostEvent(text, null);
            }
            CUICommonSystem.OpenFps();
            Singleton <CUIParticleSystem> .GetInstance().Open();

            CResourceManager.isBattleState = true;
            switch (Singleton <CNewbieAchieveSys> .GetInstance().trackFlag)
            {
            case CNewbieAchieveSys.TrackFlag.SINGLE_COMBAT_3V3_ENTER:
                MonoSingleton <NewbieGuideManager> .GetInstance().SetNewbieBit(10, true, false);

                break;

            case CNewbieAchieveSys.TrackFlag.SINGLE_MATCH_3V3_ENTER:
                MonoSingleton <NewbieGuideManager> .GetInstance().SetNewbieBit(11, true, false);

                break;

            case CNewbieAchieveSys.TrackFlag.PVE_1_1_1_Enter:
                MonoSingleton <NewbieGuideManager> .GetInstance().SetNewbieBit(13, true, false);

                break;
            }
            if (curLvelContext.IsMobaModeWithOutGuide())
            {
                Singleton <CPlayerPvpHistoryController> .get_instance().StartBattle();
            }
            MonoSingleton <PandroaSys> .GetInstance().PausePandoraSys(true);
        }
        public static void OnSelfLoadProcess(float progress)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            if (curLvelContext == null)
            {
                return;
            }
            if (curLvelContext.IsMobaModeWithOutGuide())
            {
                uint num = 0u;
                if (Singleton <WatchController> .GetInstance().IsWatching)
                {
                    Player playerByUid = Singleton <GamePlayerCenter> .GetInstance().GetPlayerByUid(Singleton <WatchController> .GetInstance().TargetUID);

                    num = ((playerByUid != null) ? playerByUid.PlayerId : 0u);
                }
                if (num == 0u)
                {
                    Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                    num = ((hostPlayer != null) ? hostPlayer.PlayerId : 0u);
                }
                GameObject memberItem = CUILoadingSystem.GetMemberItem(num);
                if (memberItem != null)
                {
                    Transform transform = memberItem.transform.Find("Txt_LoadingPct");
                    if (transform)
                    {
                        Text component = transform.GetComponent <Text>();
                        component.set_text(string.Format("{0}%", Convert.ToUInt16(progress * 100f)));
                    }
                }
                if (curLvelContext.m_isWarmBattle)
                {
                    CFakePvPHelper.FakeLoadProcess(progress);
                }
            }
            else
            {
                if (CUILoadingSystem._singlePlayerLoading == null)
                {
                    return;
                }
                CUILoadingSystem._singlePlayerLoading.m_formWidgets[2].GetComponent <Text>().set_text(string.Format("{0}%", (int)(Mathf.Clamp(progress, 0f, 1f) * 100f)));
                CUILoadingSystem._singlePlayerLoading.m_formWidgets[3].GetComponent <Image>().CustomFillAmount(Mathf.Clamp(progress, 0f, 1f));
            }
        }
        public void HideLoading()
        {
            if (Singleton <LobbyLogic> .instance.inMultiGame)
            {
                HideMultiLoading();
            }
            else
            {
                SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                if (curLvelContext != null)
                {
                    if (curLvelContext.IsMobaModeWithOutGuide())
                    {
                        HideMultiLoading();
                    }
                    else
                    {
                        this.HidePveLoading();
                    }
                }
            }
        }
        private void OnFightPrepare(ref DefaultGameEventParam prm)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

            if (curLvelContext == null)
            {
                this.m_bIsRecordMomentsEnable = false;
                return;
            }
            this.m_bIsRecordMomentsEnable = (GameSettings.EnableKingTimeMode && this.GetRecorderGlobalCfgEnableFlag() && !Singleton <WatchController> .GetInstance().IsWatching&& curLvelContext.IsMobaModeWithOutGuide());
            if (this.m_bIsRecordMomentsEnable)
            {
                if (Singleton <LobbyLogic> .get_instance().reconnGameInfo != null)
                {
                    this.m_bIsRecordMomentsEnable = false;
                    Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("RecordMomentSuspendRecord"), false, 1.5f, null, new object[0]);

                    return;
                }
                this.Reset();
                this.m_hostActor = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer().Captain;

                Singleton <GameJoy> .get_instance().StartMomentsRecording();
            }
        }