public string IsAvailable() { //Debug.Log(" "+SpawnManager.GetCurrentWaveID()); if (purchased) { return("Purchased"); } if (GameControl.GetLevelID() < minLevel) { return("Unlocked at level " + minLevel); } if (Mathf.Max(SpawnManager.GetCurrentWaveID() + 1, 1) < minWave) { return("Unlocked at Wave " + minWave); } if (PerkManager.GetPerkPoint() < minPerkPoint) { return("Insufficient perk point"); } if (prereq.Count > 0) { string text = "Require: "; bool first = true; List <Perk> perkList = PerkManager.GetPerkList(); for (int i = 0; i < prereq.Count; i++) { for (int n = 0; n < perkList.Count; n++) { if (perkList[n].ID == prereq[i]) { text += ((!first) ? ", " : "") + perkList[n].name; first = false; break; } } } return(text); //return "Not all prerequisite perk has been unlocked"; } return(""); }