// actually increasing and upgrading the animal public void IncreaseLevel() { int currentLevelIndex = levels.IndexOf(currentLevel); if (currentLevelIndex < levels.Count - 1) { CurrentLevel = levels[currentLevelIndex + 1]; } }
// check if there is an animal at the spot and see if it is upgradable private bool CanUpgradeMonster() { if (animal != null) { animalData animalData = animal.GetComponent <animalData>(); animalLevel nextLevel = animalData.GetNextLevel(); if (nextLevel != null) { return(GameManager.Gold >= nextLevel.cost); } } return(false); }
void OnEnable() { CurrentLevel = levels[0]; }