public void AddRange(T range) { var branch = target as BranchOnRange <T>; var newRange = new BranchOnRange <T> .Range { Value = range, Instruction = null }; if (!branch.Instructions.Any(other => other.Value.CompareTo(newRange.Value) == 0)) { using (new UndoScope(branch)) { branch.Instructions.Add(newRange); branch.Instructions.Sort((first, second) => first.Value.CompareTo(second.Value)); } } }
protected override float DrawRange(Rect rect, float range, BranchOnRange <float> .Range min, BranchOnRange <float> .Range max) { //return EditorGUI.Slider(rect, range, min == null ? float.MinValue + 0.01f : min.Value + 0.01f, max == null ? float.MaxValue - 0.01f : max.Value - 0.01f); return(EditorGUI.DelayedFloatField(rect, range)); }
protected override int DrawRange(Rect rect, int range, BranchOnRange <int> .Range min, BranchOnRange <int> .Range max) { return(EditorGUI.IntSlider(rect, range, min == null ? int.MinValue + 1 : min.Value + 1, max == null ? int.MaxValue - 1 : max.Value - 1)); //return EditorGUI.DelayedIntField(rect, range); }
protected abstract T DrawRange(Rect rect, T range, BranchOnRange <T> .Range min, BranchOnRange <T> .Range max);