Example #1
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            SerializedProperty scriptPathProperty  = property.FindPropertyRelative("scriptPath");
            SerializedProperty paramValuesProperty = property.FindPropertyRelative("paramValues");

            Rect headerRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);

            EGUI.DrawBoxHeader(headerRect, label.text);

            Rect scriptRect = headerRect;

            scriptRect.y     += headerRect.height;
            scriptRect.height = EditorGUIUtility.singleLineHeight * 2;
            DrawScriptProperty(scriptRect, scriptPathProperty);

            Rect paramValuesRect = scriptRect;

            paramValuesRect.y     += scriptRect.height;
            paramValuesRect.height = position.height - headerRect.height - scriptRect.height;

            string paramValuesPropertyPath = paramValuesProperty.propertyPath;

            if (!rListDic.TryGetValue(paramValuesPropertyPath, out var rList))
            {
                rList = new ReorderableListProperty(paramValuesProperty);
                rListDic.Add(paramValuesPropertyPath, rList);
            }
            rList.OnGUI(paramValuesRect);
        }
Example #2
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            Rect labelRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);

            EditorGUI.LabelField(labelRect, label);

            Rect bindRect = new Rect(labelRect.x + 20, labelRect.y + labelRect.height, labelRect.width - 20, EditorGUIUtility.singleLineHeight);
            SerializedProperty bindBehaviourProperty = property.FindPropertyRelative("m_BindBehaviour");

            EditorGUI.PropertyField(bindRect, bindBehaviourProperty);

            Rect funcNameRect = bindRect;

            funcNameRect.y += bindRect.height;
            SerializedProperty funcNameProperty = property.FindPropertyRelative("m_FuncName");

            EditorGUI.PropertyField(funcNameRect, funcNameProperty);

            Rect rlPropertyRect = funcNameRect;

            rlPropertyRect.y     += funcNameRect.height;
            rlPropertyRect.height = RLPROPERTY_HEIGHT;
            if (m_RLProperty == null)
            {
                SerializedProperty operateParamProperty = property.FindPropertyRelative("m_OperateParams");
                m_RLProperty = new ReorderableListProperty(operateParamProperty);
            }
            m_RLProperty.OnGUI(rlPropertyRect);
        }
Example #3
0
 public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
 {
     if (propertyList == null)
     {
         propertyList = new ReorderableListProperty(property);
     }
 }
Example #4
0
 public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
 {
     if (propertyList == null)
     {
         propertyList = new ReorderableListProperty(property);
     }
     return(16f);
 }
Example #5
0
        protected override void OnEnable()
        {
            base.OnEnable();
            binderBehaviourProperty = serializedObject.FindProperty("binderBehaviour");
            clickedFuncNameProperty = serializedObject.FindProperty("clickedFuncName");
            paramValuesProperty     = serializedObject.FindProperty("paramValues");

            paramValuesRLProperty = new ReorderableListProperty(paramValuesProperty);
        }
Example #6
0
        protected override void OnEnable()
        {
            base.OnEnable();
            registParamsProperty = serializedObject.FindProperty("registParams");
            registParamGroupsProperty = serializedObject.FindProperty("registParamGroups");

            registParamsRLProperty = new ReorderableListProperty(registParamsProperty);
            RefreshRegistParamGroups();
        }
Example #7
0
        private ReorderableListProperty GetReorderableList(SerializedProperty property)
        {
            ReorderableListProperty ret = null;

            if (this.reorderableLists.TryGetValue(property.name, out ret))
            {
                ret.Property = property;
                return(ret);
            }
            ret = new ReorderableListProperty(property);
            this.reorderableLists.Add(property.name, ret);
            return(ret);
        }
Example #8
0
        public static void DrawReorderableList(ReorderableListProperty listProperty)
        {
            var prop = listProperty.Property;

            if (EditorGUILayout.Foldout(prop.isExpanded, prop.displayName, true) != prop.isExpanded)
            {
                prop.isExpanded = !prop.isExpanded;
            }
            if (prop.isExpanded)
            {
                listProperty.List.DoLayoutList();
            }
        }
Example #9
0
        ReorderableListProperty GetReorderableList(SerializedProperty property)
        {
            ReorderableListProperty retVal;

            if (_reorderableLists.TryGetValue(property.name, out retVal))
            {
                retVal.Property = property;
                return(retVal);
            }
            retVal = new ReorderableListProperty(property);
            _reorderableLists[property.name] = retVal;
            return(retVal);
        }
Example #10
0
        protected override void OnEnable()
        {
            base.OnEnable();
            binderBehaviourProperty = serializedObject.FindProperty("binderBehaviour");

            changedFuncNameProperty    = serializedObject.FindProperty("changedFuncName");
            changedParamValuesProperty = serializedObject.FindProperty("changedParamValues");

            submitedFuncNameProperty    = serializedObject.FindProperty("submitedFuncName");
            submitedParamValuesProperty = serializedObject.FindProperty("submitedParamValues");

            changedParamValuesRLProperty  = new ReorderableListProperty(changedParamValuesProperty);
            submitedParamValuesRLProperty = new ReorderableListProperty(submitedParamValuesProperty);
        }
Example #11
0
        private ReorderableListProperty GetReorderableList(SerializedProperty prop, SerializedProperty otherProp)
        {
            ReorderableListProperty ret = null;

            if (reorderableLists.TryGetValue(prop.name, out ret))
            {
                ret.Property = prop;
                return(ret);
            }

            ret = new ReorderableListProperty(prop, otherProp);
            reorderableLists.Add(prop.name, ret);
            return(ret);
        }
Example #12
0
        protected void HandleArray(SerializedProperty property)
        {
            ReorderableListProperty listData = this.GetReorderableList(property);

            listData.IsExpanded.target = property.isExpanded;
            if ((!listData.IsExpanded.value && !listData.IsExpanded.isAnimating) ||
                (!listData.IsExpanded.value && listData.IsExpanded.isAnimating))
            {
                EditorGUILayout.BeginHorizontal();
                property.isExpanded = EditorGUILayout.ToggleLeft(string.Format("{0}[]", property.displayName),
                                                                 property.isExpanded, EditorStyles.boldLabel);
                EditorGUILayout.LabelField(string.Format("size: {0}", property.arraySize));
                EditorGUILayout.EndHorizontal();
            }
            else
            {
                if (EditorGUILayout.BeginFadeGroup(listData.IsExpanded.faded))
                {
                    listData.List.DoLayoutList();
                }
                EditorGUILayout.EndFadeGroup();
            }
        }
Example #13
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();
        var Data = serializedObject.FindProperty("Data");

        if (reorderableListProperty == null)
        {
            reorderableListProperty = new ReorderableListProperty(Data, false).SetAddCallBack(AddCallback);
        }
        using (FoCsEditorDisposables.HorizontalScope())
        {
            using (FoCsEditorDisposables.VerticalScope(GUILayout.Width(17f)))
            {
                EditorGUILayout.Space();
            }
            reorderableListProperty.HandleDrawing();
            using (FoCsEditorDisposables.VerticalScope(GUILayout.Width(1f)))
            {
                EditorGUILayout.Space();
            }
        }
        serializedObject.ApplyModifiedProperties();
    }
Example #14
0
 private void OnEnable()
 {
     intValuesProperty = serializedObject.FindProperty("intValues");
     rlProperty        = new ReorderableListProperty(intValuesProperty);
 }