protected virtual void DrawValue() { _readOnlyValueAnimation.target = _readOnly.boolValue; using var group = new EditorGUILayout.FadeGroupScope(_readOnlyValueAnimation.faded); if (group.visible) { GenericPropertyDrawer.DrawPropertyDrawerLayout(_valueProperty, Target.Type); } }
private void DrawElement(Rect rect, int index, bool isActive, bool isFocused) { rect = SOArchitecture_EditorUtility.GetReorderableListElementFieldRect(rect); SerializedProperty property = CollectionItemsProperty.GetArrayElementAtIndex(index); EditorGUI.BeginDisabledGroup(DISABLE_ELEMENTS); GenericPropertyDrawer.DrawPropertyDrawer(rect, property, Target.Type); EditorGUI.EndDisabledGroup(); }
private void DrawGenericPropertyField(Rect position, Rect valueRect) { if (IsConstantValueMultiline(constantValue)) { using (new EditorGUI.IndentLevelScope()) { position.y += EditorGUIUtility.singleLineHeight; position.height = GenericPropertyDrawer.GetHeight(constantValue, ValueType); GenericPropertyDrawer.DrawPropertyDrawer(position, constantValue, ValueType); } } else { GenericPropertyDrawer.DrawPropertyDrawer(valueRect, constantValue, ValueType, false); } }
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { SerializedProperty useConstant = property.FindPropertyRelative(USE_CONSTANT_VALUE_PROPERTY_NAME); SerializedProperty constantValue = property.FindPropertyRelative(CONSTANT_VALUE_PROPERTY_NAME); if (useConstant.boolValue) { if (IsConstantValueMultiline(constantValue)) { return(GenericPropertyDrawer.GetHeight(constantValue, ValueType) + EditorGUIUtility.singleLineHeight); } else { return(EditorGUIUtility.singleLineHeight); } } return(EditorGUIUtility.singleLineHeight); }
protected override void DrawRaiseButton() { SerializedProperty property = serializedObject.FindProperty("_debugValue"); using (var scope = new EditorGUI.ChangeCheckScope()) { Type debugValueType = GetDebugValueType(property); GenericPropertyDrawer.DrawPropertyDrawerLayout(property, debugValueType); if (scope.changed) { serializedObject.ApplyModifiedProperties(); } } if (GUILayout.Button("Raise")) { CallMethod(GetDebugValue(property)); } }
private bool IsConstantValueMultiline(SerializedProperty property) { return(GenericPropertyDrawer.GetHeight(property, ValueType) > MultilineThreshold); }
private Rect GetConstantMultilineRect(Rect position, Rect valueRect) { return(new Rect(position.x, valueRect.y + EditorGUIUtility.singleLineHeight, position.width, GenericPropertyDrawer.GetHeight(constantValue, ValueType))); }
private float GetHeight(int index) { SerializedProperty property = CollectionItemsProperty.GetArrayElementAtIndex(index); return(GenericPropertyDrawer.GetHeight(property, Target.Type) + EditorGUIUtility.standardVerticalSpacing); }