protected override bool OnCtrlAltLMB() { var value = !Get(target); var _selection = GetSelection(); var inSelection = _selection != null && _selection.Length > 1 && _selection.Contains(target); const h2IValue rgv = h2IValue.ToggleEach; if (inSelection) { SetTargetInGroup(value, null, getUndoName(value, h2IGroup.Selection, rgv), rgv); return(true); } SetTargetInGroup(value, GetSiblings(), getUndoName(value, h2IGroup.Siblings, rgv), rgv); return(true); }
protected void SetTargetInGroup(bool v, GameObject[] arr = null, string undoName = null, h2IValue b = h2IValue.Same, bool useEvent = true) //Action<T> a, { if (useEvent) { Event.current.Use(); } Set(target, v, undoName); if (arr == null) { return; } foreach (var item in arr) { if (item.xIsEquals(target)) { continue; } Set(item, (b == h2IValue.Same) ? v : (b == h2IValue.InvertTarget) ? !v : !Get(item), undoName); } }
virtual protected string getUndoName(bool set, h2IGroup group = h2IGroup.Target, h2IValue value = h2IValue.Same) { return(null); }
//static readonly ColorHSB ColorActive = new ColorHSB(0.15f, 0.65f, 1f, 1f); //static readonly ColorHSB ColorActiveSelf = new ColorHSB(0.15f, 0.65f, 0.7f, 1f); //static readonly ColorHSB ColorInActive = new ColorHSB(0.15f, 0f, 0.5f, 1f); protected override string getUndoName(bool set, h2IGroup group = h2IGroup.Target, h2IValue value = h2IValue.Same) { if (group == h2IGroup.Target) { return((set ? "Active " : "Deactive ") + target.name); } var g = group == h2IGroup.Selection ? "Selection" : "Siblings"; if (value != h2IValue.InvertTarget) { return("Toggle Active " + g); } return(set ? "Deactive " : "Active " + g); }
protected override string getUndoName(bool set, h2IGroup group = h2IGroup.Target, h2IValue value = h2IValue.Same) { var str = set ? "Lock " : "Unlock "; if (group == h2IGroup.Target) { return(str + target.name); } var g = group == h2IGroup.Selection ? "Selection" : "Siblings"; if (value != h2IValue.InvertTarget) { return("Toggle " + str + g); } return(set ? "Unlock " : "Lock " + g); }
protected override string getUndoName(bool set, h2IGroup group = h2IGroup.Target, h2IValue value = h2IValue.Same) { if (group == h2IGroup.Target) { return((set ? "Make " : "Clear ") + target.name + " static"); } var g = group == h2IGroup.Selection ? "Selection" : "Siblings"; if (value != h2IValue.InvertTarget) { return("Toggle static " + g); } return(set ? "Set static " : "Clear static " + g); }
protected override string getUndoName(bool set, h2IGroup group = h2IGroup.Target, h2IValue value = h2IValue.Same) { var str = set ? "Combine " : "Expand "; if (group == h2IGroup.Target) //single { return(str + target.name); } var g = group == h2IGroup.Siblings ? "Siblings" : group == h2IGroup.Selection ? "Selection" : ""; if (value != h2IValue.InvertTarget) { return("Toggle " + str + g); } return(set ? "Expand " : "Combine " + g); }