示例#1
0
        private void Start()
        {
            GameManager       instance = MonoSingleton <GameManager> .Instance;
            PlayerLevelUpInfo data     = new PlayerLevelUpInfo();
            PlayerData        player   = instance.Player;

            data.LevelNext = PlayerData.CalcLevelFromExp((int)GlobalVars.PlayerExpNew);
            data.LevelPrev = PlayerData.CalcLevelFromExp((int)GlobalVars.PlayerExpOld);
            PlayerParam playerParam1 = instance.MasterParam.GetPlayerParam(data.LevelPrev);
            PlayerParam playerParam2 = instance.MasterParam.GetPlayerParam(data.LevelNext);

            data.StaminaNext      = player.Stamina;
            data.StaminaMaxPrev   = (int)playerParam1.pt;
            data.StaminaMaxNext   = (int)playerParam2.pt;
            data.MaxFriendNumPrev = (int)playerParam1.fcap;
            data.MaxFriendNumNext = (int)playerParam2.fcap;
            List <UnlockParam> unlockParamList = new List <UnlockParam>();

            for (int index1 = data.LevelPrev + 1; index1 <= data.LevelNext; ++index1)
            {
                for (int index2 = 0; index2 < instance.MasterParam.Unlocks.Length; ++index2)
                {
                    UnlockParam unlock = instance.MasterParam.Unlocks[index2];
                    if (unlock.UnlockTarget != UnlockTargets.Tower && unlock.VipRank <= player.VipRank && (unlock.PlayerLevel == index1 && !unlockParamList.Contains(unlock)))
                    {
                        unlockParamList.Add(unlock);
                    }
                }
            }
            if (unlockParamList != null)
            {
                data.UnlockInfo = new string[unlockParamList.Count];
                for (int index = 0; index < unlockParamList.Count; ++index)
                {
                    data.UnlockInfo[index] = LocalizedText.Get("sys.UNLOCK_" + unlockParamList[index].iname.ToUpper());
                }
            }
            else
            {
                data.UnlockInfo = new string[0];
            }
            DataSource.Bind <PlayerLevelUpInfo>(((Component)this).get_gameObject(), data);
            if (Object.op_Inequality((Object)this.StaminaMax, (Object)null))
            {
                this.StaminaMax.SetActive(data.StaminaMaxPrev != data.StaminaMaxNext);
            }
            if (Object.op_Inequality((Object)this.FriendSlotMax, (Object)null))
            {
                this.FriendSlotMax.SetActive(data.MaxFriendNumPrev != data.MaxFriendNumNext);
            }
            for (int index = 0; index < this.UnlockInfo.Length; ++index)
            {
                this.UnlockInfo[index].SetActive(index < data.UnlockInfo.Length);
            }
            AnalyticsManager.TrackPlayerLevelUp(data.LevelNext);
            player.OnPlayerLevelChange(data.LevelNext - data.LevelPrev);
        }
示例#2
0
        public bool GetIsUnlockAnimationPlayable()
        {
            GameManager instance    = MonoSingleton <GameManager> .Instance;
            UnlockParam unlockParam = instance.MasterParam.FindUnlockParam(this.Condition);

            if (unlockParam != null && instance.Player.Lv >= unlockParam.PlayerLevel)
            {
                return(!PlayerPrefsUtility.GetIsUnlockLevelAnimationPlayed(this.Condition));
            }
            return(false);
        }
 private IEnumerator OrdealReleaseAnimationCoroutine(GameObject obj, UnlockParam lockState)
 {
     // ISSUE: object of a compiler-generated type is created
     return((IEnumerator) new ScrollClamped_TownMenu.\u003COrdealReleaseAnimationCoroutine\u003Ec__Iterator13B()
     {
         obj = obj,
         lockState = lockState,
         \u003C\u0024\u003Eobj = obj,
         \u003C\u0024\u003ElockState = lockState,
         \u003C\u003Ef__this = this
     });
 }
        private void OnAfterStartup(bool success)
        {
            GameManager instance  = MonoSingleton <GameManager> .Instance;
            UnlockParam lockState = ((IEnumerable <UnlockParam>)instance.MasterParam.Unlocks).FirstOrDefault <UnlockParam>((Func <UnlockParam, bool>)(unlock => unlock.UnlockTarget == UnlockTargets.Ordeal));

            if (lockState == null || PlayerPrefsUtility.HasKey(PlayerPrefsUtility.ORDEAL_RELEASE_ANIMATION_PLAYED) || instance.Player.Lv < lockState.PlayerLevel)
            {
                return;
            }
            PlayerPrefsUtility.SetInt(PlayerPrefsUtility.ORDEAL_RELEASE_ANIMATION_PLAYED, 1, false);
            this.StartCoroutine(this.OrdealReleaseAnimationCoroutine(this.ordealObj, lockState));
        }
示例#5
0
        public static void PushContentsUnlock(UnlockParam unlock)
        {
            if (unlock.UnlockTarget == UnlockTargets.Tower || !Object.op_Inequality((Object)NotifyList.mInstance, (Object)null) || (!Object.op_Inequality((Object)NotifyList.mInstance.Item_ContentsUnlock, (Object)null) || unlock == null))
            {
                return;
            }
            string         str            = LocalizedText.Get("sys.UNLOCK_" + unlock.iname.ToUpper());
            NotifyListItem notifyListItem = (NotifyListItem)Object.Instantiate <NotifyListItem>((M0)NotifyList.mInstance.Item_ContentsUnlock);

            notifyListItem.Message.set_text(LocalizedText.Get("sys.NOTIFY_CONTENTSUNLOCK", new object[1]
            {
                (object)str
            }));
            NotifyList.mInstance.Push(notifyListItem);
        }
        private void Start()
        {
            Button component = (Button)((Component)this).GetComponent <Button>();

            if (!Object.op_Implicit((Object)component) || !Object.op_Implicit((Object)this.mLockObject) || !Object.op_Implicit((Object)this.mLockText))
            {
                return;
            }
            if (MonoSingleton <GameManager> .Instance.Player.CheckUnlock(UnlockTargets.Arena))
            {
                ((Selectable)component).set_interactable(true);
                this.mLockObject.SetActive(false);
            }
            else
            {
                int           num     = 0;
                UnlockParam[] unlocks = MonoSingleton <GameManager> .Instance.MasterParam.Unlocks;
                if (unlocks == null)
                {
                    return;
                }
                for (int index = 0; index < unlocks.Length; ++index)
                {
                    UnlockParam unlockParam = unlocks[index];
                    if (unlockParam != null && unlockParam.UnlockTarget == UnlockTargets.Arena)
                    {
                        num = unlockParam.PlayerLevel;
                        break;
                    }
                }
                ((Selectable)component).set_interactable(false);
                this.mLockObject.SetActive(true);
                this.mLockText.set_text(LocalizedText.Get("sys.COINLIST_ARENA_LOCK", new object[1]
                {
                    (object)num
                }));
            }
        }