protected virtual void DrawValue()
 {
     _readOnlyValueAnimation.target = _readOnly.boolValue;
     using var group = new EditorGUILayout.FadeGroupScope(_readOnlyValueAnimation.faded);
     if (group.visible)
     {
         GenericPropertyDrawer.DrawPropertyDrawerLayout(_valueProperty, Target.Type);
     }
 }
Beispiel #2
0
        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();
        }
Beispiel #3
0
        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);
            }
        }
Beispiel #4
0
        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));
            }
        }
Beispiel #6
0
 private bool IsConstantValueMultiline(SerializedProperty property)
 {
     return(GenericPropertyDrawer.GetHeight(property, ValueType) > MultilineThreshold);
 }
Beispiel #7
0
 private Rect GetConstantMultilineRect(Rect position, Rect valueRect)
 {
     return(new Rect(position.x, valueRect.y + EditorGUIUtility.singleLineHeight, position.width, GenericPropertyDrawer.GetHeight(constantValue, ValueType)));
 }
Beispiel #8
0
        private float GetHeight(int index)
        {
            SerializedProperty property = CollectionItemsProperty.GetArrayElementAtIndex(index);

            return(GenericPropertyDrawer.GetHeight(property, Target.Type) + EditorGUIUtility.standardVerticalSpacing);
        }