private void LoadData() { //레벨 세팅 this.playerLevel = PlayerPrefs.GetInt("PlayerLv"); Tapjoy.SetUserLevel(this.playerLevel); if (PlayerPrefs.GetString("PlayerExp") != "") { this.currentExp = double.Parse(PlayerPrefs.GetString("PlayerExp")); } if (this.playerLevel == 0) { this.playerLevel = 1; this.currentExp = 0.0d; } //티어 세팅 this.currentTierIdx = PlayerPrefs.GetInt("PlayerLoadTier"); this.currentTier = GameDatabase.instance.TierDataes[this.currentTierIdx]; // this.isLoaded = true; }
public bool CheckIfTierHaveChanged() { if (GameDatabase.instance.TierDataes[this.currentTierIdx + 1].requiredRankingPercent < TheBackendManager.Instance.TopPercentToClearStageForRank) { if (GameDatabase.instance.TierDataes[this.currentTierIdx].requiredRankingPercent >= TheBackendManager.Instance.TopPercentToClearStageForRank) { return(false); } for (int i = this.currentTierIdx; i >= 0; --i) { if (GameDatabase.instance.TierDataes[i].requiredRankingPercent >= TheBackendManager.Instance.TopPercentToClearStageForRank) { this.currentTierIdx = i; this.currentTier = GameDatabase.instance.TierDataes[i]; PlayerPrefs.SetInt("PlayerLoadTier", this.currentTierIdx); this.isAdvanced = false; return(true); } } } else { for (int i = this.currentTierIdx + 1; i < GameDatabase.instance.TierDataes.Length - 1; ++i) { if (GameDatabase.instance.TierDataes[i + 1].requiredRankingPercent < TheBackendManager.Instance.TopPercentToClearStageForRank) { this.currentTierIdx = i; this.currentTier = GameDatabase.instance.TierDataes[i]; PlayerPrefs.SetInt("PlayerLoadTier", this.currentTierIdx); this.isAdvanced = true; return(true); } } } throw new System.IndexOutOfRangeException("Failed to Find Correct Tier"); }