private int GetCachedControlIndex(IActiveStateProperty target_group) { return(Enumerable.Range(0, NumberOfCachedControls) .Select(i => GetCachedControlByIndex(i)) .TakeWhile(c => !target_group.Equals(c)) .Count()); }
private void SetVisibleGroup(IActiveStateProperty[] target_groups, IActiveStateProperty selected) { foreach (IActiveStateProperty control in target_groups) { control.Active = false; } selected.Active = true; }
private void SetSelected(IActiveStateProperty value) { if (!CachedControls.Contains(value)) { throw new ArgumentException("Cannot select non-child target group"); } if (!(value is MonoBehaviour)) { throw new ArgumentException("Selected target group must inherit MonoBehaviour"); } _SelectedBehavior = (MonoBehaviour)value; SetVisibleGroup(CachedControls, value); }
public GroupTargetKey(ITargetGroup group, IActiveStateProperty active_state_property) { Group = group; ActiveStateProperty = active_state_property; }