private void AddPaintButton(ScheduleGroup group) { SchedulePaintButton schedulePaintButton = Util.KInstantiateUI <SchedulePaintButton>(paintButtonPrefab.gameObject, paintButtonContainer, true); schedulePaintButton.SetGroup(group, paintStyles, OnPaintButtonClick); schedulePaintButton.SetToggle(false); paintButtons.Add(schedulePaintButton); }
private void OnPaintButtonClick(SchedulePaintButton clicked) { if ((Object)selectedPaint != (Object)clicked) { foreach (SchedulePaintButton paintButton in paintButtons) { paintButton.SetToggle((Object)paintButton == (Object)clicked); } selectedPaint = clicked; } else { clicked.SetToggle(false); selectedPaint = null; } }