Пример #1
0
        private void ShowPveLoading()
        {
            _singlePlayerLoading = Singleton <CUIManager> .GetInstance().OpenForm(PVE_PATH_LOADING, false, true);

            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            int randNum = 0;

            if (curLvelContext != null)
            {
                if (curLvelContext.IsGameTypeGuide())
                {
                    if (curLvelContext.m_mapID == 1)
                    {
                        randNum = 1;
                    }
                    else if (curLvelContext.m_mapID == 3)
                    {
                        randNum = 2;
                    }
                    else if (curLvelContext.m_mapID == 8)
                    {
                        randNum = 3;
                    }
                    else
                    {
                        randNum = GenerateSoloRandomNum();
                    }
                }
                else
                {
                    randNum = GenerateSoloRandomNum();
                }
            }
            _singlePlayerLoading.m_formWidgets[1].GetComponent <Text>().text = GenerateRandomPveLoadingTips(randNum);
            _singlePlayerLoading.m_formWidgets[2].GetComponent <Text>().text = string.Format("{0}%", 0);
            _singlePlayerLoading.m_formWidgets[3].GetComponent <Image>().CustomFillAmount(0f);
            Image component = _singlePlayerLoading.m_formWidgets[4].GetComponent <Image>();

            if (randNum >= 4)
            {
                MonoSingleton <BannerImageSys> .GetInstance().TrySetLoadingImage((uint)randNum, component);
            }
            else
            {
                component.SetSprite(string.Format("{0}{1}{2}", "UGUI/Sprite/Dynamic/", "Loading/LoadingNotice", randNum), _singlePlayerLoading, true, false, false);
            }
        }
        private void ShowPveLoading()
        {
            CUILoadingSystem._singlePlayerLoading = Singleton <CUIManager> .GetInstance().OpenForm(CUILoadingSystem.PVE_PATH_LOADING, false, true);

            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            int num = 0;

            if (curLvelContext != null)
            {
                if (curLvelContext.IsGameTypeGuide())
                {
                    if (CBattleGuideManager.Is1v1GuideLevel(curLvelContext.m_mapID))
                    {
                        num = 1;
                    }
                    else if (CBattleGuideManager.Is5v5GuideLevel(curLvelContext.m_mapID))
                    {
                        num = 2;
                    }
                    else if (curLvelContext.m_mapID == 8)
                    {
                        num = 3;
                    }
                    else
                    {
                        num = CUILoadingSystem.GenerateSoloRandomNum();
                    }
                }
                else
                {
                    num = CUILoadingSystem.GenerateSoloRandomNum();
                }
            }
            CUILoadingSystem._singlePlayerLoading.m_formWidgets[1].GetComponent <Text>().set_text(CUILoadingSystem.GenerateRandomPveLoadingTips(num));
            CUILoadingSystem._singlePlayerLoading.m_formWidgets[2].GetComponent <Text>().set_text(string.Format("{0}%", 0));
            CUILoadingSystem._singlePlayerLoading.m_formWidgets[3].GetComponent <Image>().CustomFillAmount(0f);
            Image component = CUILoadingSystem._singlePlayerLoading.m_formWidgets[4].GetComponent <Image>();

            if (num >= 4)
            {
                MonoSingleton <BannerImageSys> .GetInstance().TrySetLoadingImage((uint)num, component);
            }
            else
            {
                component.SetSprite(string.Format("{0}{1}{2}", "UGUI/Sprite/Dynamic/", "Loading/LoadingNotice", num), CUILoadingSystem._singlePlayerLoading, true, false, false, false);
            }
        }
Пример #3
0
        public void Init(GameObject obj)
        {
            this.m_Obj = obj;
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            if (curLvelContext.IsMobaMode() || curLvelContext.IsGameTypeGuide() || curLvelContext.IsGameTypeBurning() || curLvelContext.IsGameTypeArena())
            {
                this.Hide();
                return;
            }
            this.Show();
            this.bPanelOpen = false;
            this.taskPanel  = this.m_Obj.transform.Find("TaskPanel").gameObject;
            this.arrowIcon  = this.m_Obj.transform.Find("Image").gameObject;
            this.taskPanel.CustomSetActive(false);
            this.PanelIcon = this.m_Obj.transform.Find("icon").GetComponent <Image>();
            this.initEvent();
            UT.If_Null_Error <GameObject>(this.m_Obj);
            UT.If_Null_Error <GameObject>(this.taskPanel);
            UT.If_Null_Error <Image>(this.PanelIcon);
        }
Пример #4
0
        public void InitReplayKit(Transform container, bool autoRecord = false, bool autoPreview = false)
        {
            if (container == null)
            {
                return;
            }
            if (!this.Cap)
            {
                container.gameObject.CustomSetActive(false);
                return;
            }
            if (!GameSettings.EnableReplayKit)
            {
                container.gameObject.CustomSetActive(false);
                return;
            }
            CReplayKitSys.StorageStatus storageStatus  = this.CheckStorage(false);
            CReplayKitSys.StorageStatus storageStatus2 = storageStatus;
            if (storageStatus2 == CReplayKitSys.StorageStatus.Disable)
            {
                container.gameObject.CustomSetActive(false);
                CUIEvent cUIEvent = new CUIEvent();
                cUIEvent.m_eventID          = enUIEventID.ReplayKit_Pause_Recording;
                cUIEvent.m_eventParams.tag2 = 1;
                Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(cUIEvent);

                return;
            }
            if (Singleton <BattleLogic> .GetInstance().isRuning)
            {
                SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                if (curLvelContext != null && (curLvelContext.IsGameTypeGuide() || !curLvelContext.IsMobaMode()))
                {
                    container.gameObject.CustomSetActive(false);
                    CUIEvent cUIEvent2 = new CUIEvent();
                    cUIEvent2.m_eventID          = enUIEventID.ReplayKit_Pause_Recording;
                    cUIEvent2.m_eventParams.tag2 = 1;
                    Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(cUIEvent2);

                    return;
                }
            }
            else if (Singleton <CHeroSelectBaseSystem> .get_instance().m_isInHeroSelectState&& (Singleton <CHeroSelectBaseSystem> .GetInstance().IsSpecTraingMode() || !Singleton <CHeroSelectBaseSystem> .GetInstance().IsMobaMode()))
            {
                container.gameObject.CustomSetActive(false);
                CUIEvent cUIEvent3 = new CUIEvent();
                cUIEvent3.m_eventID          = enUIEventID.ReplayKit_Pause_Recording;
                cUIEvent3.m_eventParams.tag2 = 1;
                Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(cUIEvent3);

                return;
            }
            Transform transform  = container.transform.Find("Recording");
            Transform transform2 = container.transform.Find("Paused");
            Transform transform3 = container.transform.Find("Transition");

            if (transform == null || transform2 == null)
            {
                container.gameObject.CustomSetActive(false);
                return;
            }
            CUIEventScript component  = transform.GetComponent <CUIEventScript>();
            CUIEventScript component2 = transform2.GetComponent <CUIEventScript>();

            if (component != null)
            {
                component.m_onClickEventID = enUIEventID.ReplayKit_Pause_Recording;
                if (autoPreview)
                {
                    component.m_onClickEventParams.tag = 1;
                }
            }
            if (component2 != null)
            {
                component2.m_onClickEventID = enUIEventID.ReplayKit_Start_Recording;
            }
            if (autoRecord)
            {
                if (GameSettings.EnableReplayKitAutoMode)
                {
                    transform.gameObject.CustomSetActive(true);
                    transform2.gameObject.CustomSetActive(false);
                    transform3.gameObject.CustomSetActive(false);
                    Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.ReplayKit_Start_Recording);
                }
                else if (this.IsRecording())
                {
                    transform.gameObject.CustomSetActive(true);
                    transform2.gameObject.CustomSetActive(false);
                    transform3.gameObject.CustomSetActive(false);
                }
                else
                {
                    transform.gameObject.CustomSetActive(false);
                    transform2.gameObject.CustomSetActive(true);
                    transform3.gameObject.CustomSetActive(false);
                }
            }
            else if (this.IsRecording())
            {
                transform.gameObject.CustomSetActive(true);
                transform2.gameObject.CustomSetActive(false);
                transform3.gameObject.CustomSetActive(false);
            }
            else
            {
                transform.gameObject.CustomSetActive(false);
                transform2.gameObject.CustomSetActive(true);
                transform3.gameObject.CustomSetActive(false);
            }
        }