void spawnNewSkillButton(Skill skill) { var newButton = Instantiate(buttonPrefab); SkillButton skillButton = newButton.GetComponent <SkillButton>(); skillButton.setSkill(skill); skillButton.setCallback(() => callSkill(skill)); newButton.transform.SetParent(buttonContainer.transform); newButton.transform.localScale = new Vector3(1, 1, 1); skillButton.setButtonIndex(System.Array.IndexOf(currentSkills, skill)); skillButton.transform.position = new Vector3(skillButton.transform.position.x, skillButton.transform.position.y, -5); }