Example #1
0
        public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
        {
            float typeWidth = 50;
            float hWidth    = pos.width - typeWidth;

            pos.width = typeWidth;
            EditorGUI.PropertyField(pos, prop.FindPropertyRelative("type"), GUITools.noContent, true);
            pos.x += pos.width;

            pos.width = hWidth;
            ParametersDrawer.DrawParamGUIFlat(pos, prop);
        }
Example #2
0
        void DrawParameters(ref Rect pos, SerializedProperty prop, bool showParameters, float origX, float origWidth)
        {
            pos.y    += GUITools.singleLineHeight;
            pos.x     = origX;
            pos.width = origWidth;

            if (showParameters)
            {
                EditorGUI.PropertyField(pos, prop.FindPropertyRelative("parameters"), true);
            }
            else
            {
                SerializedProperty paramsProp = prop.FindPropertyRelative("parameters");

                if (paramsProp.FindPropertyRelative("list").arraySize > 0)
                {
                    pos.x     += GUITools.iconButtonWidth;
                    pos.width -= GUITools.iconButtonWidth;

                    ParametersDrawer.DrawFlat(pos, paramsProp);
                }
            }
        }