public void UseTalent(Talent talent, int talentId) { if (MyPoints > 0) { switch (talentId) { case 0: talent.GetComponent <DmgBuff>().Click(); break; case 1: talent.GetComponent <HealthRegen>().Click(); break; case 2: talent.GetComponent <MoveSpeedBuff>().Click(); break; default: Debug.Log("Trying to call Use Talent with out of range talentId (" + talentId + ")"); break; } MyPoints--; } }