private void FloatField(Rect position, RectTransformEditor.FloatGetter getter, RectTransformEditor.FloatSetter setter, DrivenTransformProperties driven, GUIContent label) { EditorGUI.BeginDisabledGroup(base.targets.Any((UnityEngine.Object x) => ((x as RectTransform).drivenProperties & driven) != DrivenTransformProperties.None)); float value = getter(this.target as RectTransform); EditorGUI.showMixedValue = (( from x in base.targets select getter(x as RectTransform)).Distinct<float>().Count<float>() >= 2); EditorGUI.BeginChangeCheck(); float f = EditorGUI.FloatField(position, label, value); if (EditorGUI.EndChangeCheck()) { Undo.RecordObjects(base.targets, "Inspector"); UnityEngine.Object[] targets = base.targets; for (int i = 0; i < targets.Length; i++) { RectTransform rect = (RectTransform)targets[i]; setter(rect, f); } } EditorGUI.EndDisabledGroup(); }
private void Vector2Field(Rect position, RectTransformEditor.FloatGetter xGetter, RectTransformEditor.FloatSetter xSetter, RectTransformEditor.FloatGetter yGetter, RectTransformEditor.FloatSetter ySetter, DrivenTransformProperties xDriven, DrivenTransformProperties yDriven, SerializedProperty xProperty, SerializedProperty yProperty, GUIContent label) { EditorGUI.PrefixLabel(position, -1, label); float labelWidth = EditorGUIUtility.labelWidth; int indentLevel = EditorGUI.indentLevel; Rect columnRect = this.GetColumnRect(position, 0); Rect columnRect2 = this.GetColumnRect(position, 1); EditorGUIUtility.labelWidth = 13f; EditorGUI.indentLevel = 0; EditorGUI.BeginProperty(columnRect, RectTransformEditor.s_XYLabels[0], xProperty); this.FloatField(columnRect, xGetter, xSetter, xDriven, RectTransformEditor.s_XYLabels[0]); EditorGUI.EndProperty(); EditorGUI.BeginProperty(columnRect, RectTransformEditor.s_XYLabels[1], yProperty); this.FloatField(columnRect2, yGetter, ySetter, yDriven, RectTransformEditor.s_XYLabels[1]); EditorGUI.EndProperty(); EditorGUIUtility.labelWidth = labelWidth; EditorGUI.indentLevel = indentLevel; }
private void FloatField(Rect position, RectTransformEditor.FloatGetter getter, RectTransformEditor.FloatSetter setter, DrivenTransformProperties driven, GUIContent label) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type RectTransformEditor.\u003CFloatField\u003Ec__AnonStorey99 fieldCAnonStorey99 = new RectTransformEditor.\u003CFloatField\u003Ec__AnonStorey99(); // ISSUE: reference to a compiler-generated field fieldCAnonStorey99.driven = driven; // ISSUE: reference to a compiler-generated field fieldCAnonStorey99.getter = getter; // ISSUE: reference to a compiler-generated method EditorGUI.BeginDisabledGroup(((IEnumerable<UnityEngine.Object>) this.targets).Any<UnityEngine.Object>(new Func<UnityEngine.Object, bool>(fieldCAnonStorey99.\u003C\u003Em__1AF))); // ISSUE: reference to a compiler-generated field float num = fieldCAnonStorey99.getter(this.target as RectTransform); // ISSUE: reference to a compiler-generated method EditorGUI.showMixedValue = ((IEnumerable<UnityEngine.Object>) this.targets).Select<UnityEngine.Object, float>(new Func<UnityEngine.Object, float>(fieldCAnonStorey99.\u003C\u003Em__1B0)).Distinct<float>().Count<float>() >= 2; EditorGUI.BeginChangeCheck(); float f = EditorGUI.FloatField(position, label, num); if (EditorGUI.EndChangeCheck()) { Undo.RecordObjects(this.targets, "Inspector"); foreach (RectTransform target in this.targets) setter(target, f); } EditorGUI.EndDisabledGroup(); }
private void FloatFieldLabelAbove(Rect position, RectTransformEditor.FloatGetter getter, RectTransformEditor.FloatSetter setter, DrivenTransformProperties driven, GUIContent label) { EditorGUI.BeginDisabledGroup(base.targets.Any((UnityEngine.Object x) => ((x as RectTransform).drivenProperties & driven) != DrivenTransformProperties.None)); float value = getter(this.target as RectTransform); EditorGUI.showMixedValue = (( from x in base.targets select getter(x as RectTransform)).Distinct<float>().Count<float>() >= 2); EditorGUI.BeginChangeCheck(); int controlID = GUIUtility.GetControlID(RectTransformEditor.s_FloatFieldHash, FocusType.Keyboard, position); Rect rect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight); Rect position2 = new Rect(position.x, position.y + EditorGUIUtility.singleLineHeight, position.width, EditorGUIUtility.singleLineHeight); EditorGUI.HandlePrefixLabel(position, rect, label, controlID); float f = EditorGUI.DoFloatField(EditorGUI.s_RecycledEditor, position2, rect, controlID, value, EditorGUI.kFloatFieldFormatString, EditorStyles.textField, true); if (EditorGUI.EndChangeCheck()) { Undo.RecordObjects(base.targets, "Inspector"); UnityEngine.Object[] targets = base.targets; for (int i = 0; i < targets.Length; i++) { RectTransform rect2 = (RectTransform)targets[i]; setter(rect2, f); } } EditorGUI.EndDisabledGroup(); }
private void FloatFieldLabelAbove(Rect position, RectTransformEditor.FloatGetter getter, RectTransformEditor.FloatSetter setter, DrivenTransformProperties driven, GUIContent label) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type RectTransformEditor.\u003CFloatFieldLabelAbove\u003Ec__AnonStorey98 aboveCAnonStorey98 = new RectTransformEditor.\u003CFloatFieldLabelAbove\u003Ec__AnonStorey98(); // ISSUE: reference to a compiler-generated field aboveCAnonStorey98.driven = driven; // ISSUE: reference to a compiler-generated field aboveCAnonStorey98.getter = getter; // ISSUE: reference to a compiler-generated method EditorGUI.BeginDisabledGroup(((IEnumerable<UnityEngine.Object>) this.targets).Any<UnityEngine.Object>(new Func<UnityEngine.Object, bool>(aboveCAnonStorey98.\u003C\u003Em__1AD))); // ISSUE: reference to a compiler-generated field float num = aboveCAnonStorey98.getter(this.target as RectTransform); // ISSUE: reference to a compiler-generated method EditorGUI.showMixedValue = ((IEnumerable<UnityEngine.Object>) this.targets).Select<UnityEngine.Object, float>(new Func<UnityEngine.Object, float>(aboveCAnonStorey98.\u003C\u003Em__1AE)).Distinct<float>().Count<float>() >= 2; EditorGUI.BeginChangeCheck(); int controlId = GUIUtility.GetControlID(RectTransformEditor.s_FloatFieldHash, FocusType.Keyboard, position); Rect rect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight); Rect position1 = new Rect(position.x, position.y + EditorGUIUtility.singleLineHeight, position.width, EditorGUIUtility.singleLineHeight); EditorGUI.HandlePrefixLabel(position, rect, label, controlId); float f = EditorGUI.DoFloatField(EditorGUI.s_RecycledEditor, position1, rect, controlId, num, EditorGUI.kFloatFieldFormatString, EditorStyles.textField, true); if (EditorGUI.EndChangeCheck()) { Undo.RecordObjects(this.targets, "Inspector"); foreach (RectTransform target in this.targets) setter(target, f); } EditorGUI.EndDisabledGroup(); }