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); }
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); }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { if (propertyList == null) { propertyList = new ReorderableListProperty(property); } }
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { if (propertyList == null) { propertyList = new ReorderableListProperty(property); } return(16f); }
protected override void OnEnable() { base.OnEnable(); binderBehaviourProperty = serializedObject.FindProperty("binderBehaviour"); clickedFuncNameProperty = serializedObject.FindProperty("clickedFuncName"); paramValuesProperty = serializedObject.FindProperty("paramValues"); paramValuesRLProperty = new ReorderableListProperty(paramValuesProperty); }
protected override void OnEnable() { base.OnEnable(); registParamsProperty = serializedObject.FindProperty("registParams"); registParamGroupsProperty = serializedObject.FindProperty("registParamGroups"); registParamsRLProperty = new ReorderableListProperty(registParamsProperty); RefreshRegistParamGroups(); }
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); }
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(); } }
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); }
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); }
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); }
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(); } }
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(); }
private void OnEnable() { intValuesProperty = serializedObject.FindProperty("intValues"); rlProperty = new ReorderableListProperty(intValuesProperty); }