private void DrawExpanded(ReflectedProperty property, ResponseCurve curve) { DrawHeaderBox(property, false, curve); property["curve"].Value = EditorGUIX.ResponseCurveField(guiRect.GetFieldRect(7), curve); guiRect.GetFieldRect(); EditorGUIX.DrawProperties(guiRect.GetRect(), property, new[] { "curve" }); }
public override void OnGUI(Rect position, ReflectedProperty property, GUIContent label) { position = EditorGUI.IndentedRect(position); GUIRect guiRect = new GUIRect(position); string goalName = property.Type.Name.Replace("Goal", ""); goalName = $"[{ObjectNames.NicifyVariableName(goalName)}]"; GUIContent content = EditorGUIX.TempLabel(goalName); Rect rect = guiRect.GetFieldRect(); rect.width *= 0.25f; EditorGUIX.Foldout(rect, property, content); rect.x += rect.width; rect.width = rect.width * 3f; EditorGUIX.PropertyField(rect, property[NameField], GUIContent.none); if (property.IsExpanded) { EditorGUIX.DrawProperties(guiRect, property, SkipList); ReorderableListGUI.ListFieldAbsolute(EditorGUI.IndentedRect(guiRect.GetRect()), adapter); } }
public override void OnGUI(Rect position, ReflectedProperty property, GUIContent label = null) { guiRect.SetRect(position); Initialize(property); int index = -1; int newIndex; if (property.Value != null) { index = Array.IndexOf(subclasses, property.Type); } if (index != -1) { Rect rect = guiRect.GetFieldRect(); float width = EditorGUIUtility.labelWidth; Rect r1 = new Rect(rect) { width = width }; Rect r2 = new Rect(rect) { x = rect.x + width, width = rect.width - width }; property.IsExpanded = EditorGUI.Foldout(r1, property.IsExpanded, property.Label); newIndex = EditorGUI.Popup(r2, index + 1, subclassNames) - 1; } else { newIndex = EditorGUI.Popup(guiRect.GetFieldRect(), property.Label, index + 1, subclassNames) - 1; } if (index != newIndex) { property.SetValueAndCopyCompatibleProperties( newIndex == -1 ? null : EditorReflector.MakeInstance(subclasses[newIndex]) ); property.IsExpanded = newIndex != -1; } if (property.IsExpanded && newIndex != -1) { EditorGUI.indentLevel += 2; EditorGUIX.DrawProperties(guiRect.GetRect(), property); EditorGUI.indentLevel -= 2; } }
public override void OnGUI(Rect position, ReflectedProperty property, GUIContent label) { guiRect.SetRect(position); string typeName = $"[{StringUtil.NicifyName(property.Type.Name, "Action")}]"; GUIContent content = EditorGUIX.TempLabel(typeName); Rect rect = guiRect.GetFieldRect(); rect.width *= 0.25f; EditorGUIX.Foldout(rect, property, content); rect.x += rect.width; rect.width = rect.width * 3f; EditorGUIX.PropertyField(rect, property[NameField], GUIContent.none); if (property.IsExpanded) { EditorGUIX.DrawProperties(guiRect, property, SkipList); EditorGUIX.PropertyField(guiRect, property[nameof(AIAction.considerations)]); } }
private void DrawCollapsed(ReflectedProperty property, ResponseCurve curve) { DrawHeaderBox(property, true, curve); EditorGUIX.DrawProperties(guiRect.GetRect(), property, new[] { "curve" }); }
public override void OnGUI(Rect position, ReflectedProperty property, GUIContent label) { guiRect.SetRect(position); EditorGUIX.PropertyField(guiRect.GetFieldRect(), property["name"]); EditorGUIX.DrawProperties(guiRect.GetFieldRect(8), property, new [] { "name" }); }