public void TriggerOnCheckedChanged(UIToggleButton toggleButton, bool isChecked) { if (OnCheckedChanged != null) { OnCheckedChanged(toggleButton, isChecked); } }
public void UnregisterToggleButtonInGroup(string groupName, UIToggleButton toggleButton) { HashSet <UIToggleButton> toggleButtonsInGroup; if (mToggleButtonGroups.TryGetValue(groupName, out toggleButtonsInGroup)) { toggleButtonsInGroup.Remove(toggleButton); } else { Debug.LogWarning("Toggle Button group name not found: " + groupName); } }
public void UncheckOtherToggleButtonsInGroup(string groupName, UIToggleButton otherThan) { HashSet <UIToggleButton> toggleButtonsInGroup; if (mToggleButtonGroups.TryGetValue(groupName, out toggleButtonsInGroup)) { foreach (UIToggleButton toggleButton in toggleButtonsInGroup) { if (toggleButton != otherThan) { toggleButton.pChecked = false; } } } }
public void RegisterToggleButtonInGroup(string groupName, UIToggleButton toggleButton) { HashSet <UIToggleButton> toggleButtonsInGroup; if (mToggleButtonGroups.TryGetValue(groupName, out toggleButtonsInGroup)) { toggleButtonsInGroup.Add(toggleButton); } else { toggleButtonsInGroup = new HashSet <UIToggleButton>(); toggleButtonsInGroup.Add(toggleButton); mToggleButtonGroups[groupName] = toggleButtonsInGroup; } }
protected virtual void OnCheckedChanged(UIToggleButton toggleButton, bool isChecked) { }