Exemplo n.º 1
0
        private void UpdatePlayerAttributes()
        {
            LevelSpecification levelByXP = GetLevelSpecification();

            if (currentPlayerData.CurrentLevelSpecification != null && levelByXP.Level > currentPlayerData.CurrentLevelSpecification.Level)
            {
                Debug.Log("Player LEVELED UP");
            }

            currentPlayerData.CurrentLevelSpecification = levelByXP;
        }
Exemplo n.º 2
0
        private LevelSpecification GetLevelSpecification()
        {
            for (int i = 0; i < playerdataConfig.CharacterProgression.Length; i++)
            {
                LevelSpecification tempLevelSpecification = playerdataConfig.CharacterProgression[i];

                if (currentPlayerData.CurrentExperience >= tempLevelSpecification.MinimumExperience &&
                    currentPlayerData.CurrentExperience < tempLevelSpecification.MaximumExperience)
                {
                    return(tempLevelSpecification);
                }
            }
            return(playerdataConfig.CharacterProgression[playerdataConfig.CharacterProgression.Length - 1]);
        }