// Unity methods protected override void Awake() { base.Awake(); for (int cc = 0; cc < ActionButtonLabels.Length; cc++) { ButtonStruct bs = this [cc]; bs.name = ActionButtonLabels[cc]; bs.label = ActionButtonLabels[cc]; bs.active = false; bs.onClick = new Button.ButtonClickedEvent(); this [cc] = bs; } }
public new ButtonStruct this [int index] { get { ButtonStruct bs = new ButtonStruct(); bs.name = MenuChoices[index].name; bs.label = MenuLabels[index]; bs.active = MenuChoices[index].interactable; bs.onClick = MenuChoices[index].onClick; return(bs); } set { MenuChoices[index].interactable = value.active; MenuChoices[index].name = value.name; MenuLabels[index] = value.label; MenuChoices[index].onClick = value.onClick; } }