示例#1
0
        public static void OnSelfLoadProcess(float progress)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            if (curLvelContext != null)
            {
                if ((((curLvelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_COMBAT) || (curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_PVP_MATCH)) || ((curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_PVP_ROOM) || (curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_LADDER))) || ((curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_ENTERTAINMENT) || (curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_REWARDMATCH)))
                {
                    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.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));
                }
            }
        }
示例#2
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));
                }
            }
        }
        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));
            }
        }