private void CreateButton(CrewMember c, ContentManager cm) { Button button = cm.CreateButton(c.GetComponent <SpriteRenderer> ().sprite, c.personName); button.onClick.AddListener(delegate { selectionManager.Select(c, true); SetCurrent(button); }); }
protected void PopulateCrewMenu() { for (int i = 0; i < otherShip.crewMembers.Count; i++) { CrewMember c = otherShip.crewMembers [i]; Button button = otherPeopleContent.CreateButton(c.GetComponent <SpriteRenderer> ().sprite, c.personName); button.onClick.AddListener(delegate { SetCurrent(button); selectionManager.Select(c, true); ToggleCrewActions(true); }); } }