public static float GetElementHeight(Type objType, MemberInfo attrs, GUIContent label, object obj, fiGraphMetadataChild metadata, params Type[] skippedEditors) { if (VerifyBinding("PropertyEditor.GetElementHeight", _Bindings._PropertyEditor_GetElementHeight)) { return _Bindings._PropertyEditor_GetElementHeight(objType, attrs, label, obj, metadata, skippedEditors); } return 0; }
public static object Edit(Type objType, MemberInfo attrs, Rect rect, GUIContent label, object obj, fiGraphMetadataChild metadata, params Type[] skippedEditors) { if (VerifyBinding("PropertyEditor.Edit", _Bindings._PropertyEditor_Edit)) { return _Bindings._PropertyEditor_Edit(objType, attrs, rect, label, obj, metadata, skippedEditors); } return obj; }
public static object EditSkipUntilNot(Type[] skipUntilNot, Type objType, MemberInfo attrs, Rect rect, GUIContent label, object obj, fiGraphMetadataChild metadata) { if (VerifyBinding("PropertyEditor.EditSkipUntilNot", _Bindings._PropertyEditor_EditSkipUntilNot)) { return _Bindings._PropertyEditor_EditSkipUntilNot(skipUntilNot, objType, attrs, rect, label, obj, metadata); } return obj; }
/// <summary> /// Draws a GUI for editing the given property and returns the updated value. This does /// *not* write the updated value to a container. /// </summary> public static object EditPropertyDirect(Rect region, InspectedProperty property, object propertyValue, fiGraphMetadataChild metadataChild) { return(EditPropertyDirect(region, property, propertyValue, metadataChild, null)); }
private static float GetItemHeight(UnityObject item, fiGraphMetadataChild metadata) { return EditorStyles.label.CalcHeight(GUIContent.none, 100); }
/// <summary> /// Draws a GUI for editing the given property and returns the updated /// value. This does /// *not* write the updated value to a container. /// </summary> /// <param name="context"> /// An optional context that the property value came from. If this is not /// given, then a prefab context menu will not be displayable. /// </param> public static object EditPropertyDirect(Rect region, InspectedProperty property, object propertyValue, fiGraphMetadataChild metadataChild, object context) { fiGraphMetadata metadata = metadataChild.Metadata; // Show a "revert to prefab" value context-menu if possible if (context != null) { RevertPrefabContextMenu(region, context, property); } // get the label / tooltip GUIContent label = new GUIContent(property.DisplayName, InspectorTooltipAttribute.GetTooltip(property.MemberInfo)); var editorChain = PropertyEditor.Get(property.StorageType, property.MemberInfo); IPropertyEditor editor = editorChain.FirstEditor; EditorGUI.BeginDisabledGroup(property.CanWrite == false); propertyValue = editor.Edit(region, label, propertyValue, metadata.Enter("EditProperty", metadata.Context)); EditorGUI.EndDisabledGroup(); return propertyValue; }
public static float EditPropertyHeightDirect(InspectedProperty property, object propertyValue, fiGraphMetadataChild metadataChild) { fiGraphMetadata metadata = metadataChild.Metadata; var editor = PropertyEditor.Get(property.StorageType, property.MemberInfo).FirstEditor; GUIContent propertyLabel = new GUIContent(property.DisplayName); // Either the foldout is active or we are not displaying a foldout. // Either way, we want to report the full height of the property. return editor.GetElementHeight(propertyLabel, propertyValue, metadata.Enter("EditProperty", metadata.Context)); }
public static float GetElementHeight(Type objType, MemberInfo attrs, GUIContent label, object obj, fiGraphMetadataChild metadata, params Type[] skippedEditors) { if (VerifyBinding("PropertyEditor.GetElementHeight", _Bindings._PropertyEditor_GetElementHeight)) { return(_Bindings._PropertyEditor_GetElementHeight(objType, attrs, label, obj, metadata, skippedEditors)); } return(0); }
public static object EditSkipUntilNot(Type[] skipUntilNot, Type objType, MemberInfo attrs, Rect rect, GUIContent label, object obj, fiGraphMetadataChild metadata) { if (VerifyBinding("PropertyEditor.EditSkipUntilNot", _Bindings._PropertyEditor_EditSkipUntilNot)) { return(_Bindings._PropertyEditor_EditSkipUntilNot(skipUntilNot, objType, attrs, rect, label, obj, metadata)); } return(obj); }
public static float EditPropertyHeight(object container, InspectedProperty property, fiGraphMetadataChild metadata) { object propertyValue = property.Read(container); return(EditPropertyHeightDirect(property, propertyValue, metadata)); }
public static object Edit(Type objType, MemberInfo attrs, Rect rect, GUIContent label, object obj, fiGraphMetadataChild metadata, params Type[] skippedEditors) { if (VerifyBinding("PropertyEditor.Edit", _Bindings._PropertyEditor_Edit)) { return(_Bindings._PropertyEditor_Edit(objType, attrs, rect, label, obj, metadata, skippedEditors)); } return(obj); }
public static float EditPropertyHeightDirect(InspectedProperty property, object propertyValue, fiGraphMetadataChild metadataChild) { fiGraphMetadata metadata = metadataChild.Metadata; var editor = PropertyEditor.Get(property.StorageType, property.MemberInfo).FirstEditor; GUIContent propertyLabel = new GUIContent(property.DisplayName); // Either the foldout is active or we are not displaying a foldout. Either way, we want // to report the full height of the property. return(editor.GetElementHeight(propertyLabel, propertyValue, metadata.Enter("EditProperty"))); }
public static void EditProperty(Rect region, object container, InspectedProperty property, fiGraphMetadataChild metadata) { EditorGUI.BeginChangeCheck(); object propertyValue = property.Read(container); object updatedValue = EditPropertyDirect(region, property, propertyValue, metadata, container); if (EditorGUI.EndChangeCheck()) { property.Write(container, updatedValue); // Make sure we propagate the changes up the edit stack. For example, if this property // is on a struct on a struct, then the top-level struct will not get modified without // propagation of the change check. GUI.changed = true; } }
/// <summary> /// Draws a GUI for editing the given property and returns the updated value. This does /// *not* write the updated value to a container. /// </summary> /// <param name="context">An optional context that the property value came from. If this is not given, then a prefab context menu will not be displayable.</param> public static object EditPropertyDirect(Rect region, InspectedProperty property, object propertyValue, fiGraphMetadataChild metadataChild, object context) { fiGraphMetadata metadata = metadataChild.Metadata; // Show a "revert to prefab" value context-menu if possible if (context != null) { RevertPrefabContextMenu(region, context, property); } // get the label / tooltip var tooltip = fsPortableReflection.GetAttribute <InspectorTooltipAttribute>(property.MemberInfo); GUIContent label = new GUIContent(property.DisplayName, tooltip != null ? tooltip.Tooltip : ""); var editorChain = PropertyEditor.Get(property.StorageType, property.MemberInfo); IPropertyEditor editor = editorChain.FirstEditor; EditorGUI.BeginDisabledGroup(property.CanWrite == false); propertyValue = editor.Edit(region, label, propertyValue, metadata.Enter("EditProperty")); EditorGUI.EndDisabledGroup(); return(propertyValue); }
public static float GetElementHeightSkipUntilNot(Type[] skipUntilNot, Type objType, MemberInfo attrs, GUIContent label, object obj, fiGraphMetadataChild metadata) { if (VerifyBinding("PropertyEditor.GetElementHeightSkipUntilNot", _Bindings._PropertyEditor_GetElementHeightSkipUntilNot)) { return _Bindings._PropertyEditor_GetElementHeightSkipUntilNot(skipUntilNot, objType, attrs, label, obj, metadata); } return 0; }
public static float GetElementHeightSkipUntilNot(Type[] skipUntilNot, Type objType, MemberInfo attrs, GUIContent label, object obj, fiGraphMetadataChild metadata) { if (VerifyBinding("PropertyEditor.GetElementHeightSkipUntilNot", _Bindings._PropertyEditor_GetElementHeightSkipUntilNot)) { return(_Bindings._PropertyEditor_GetElementHeightSkipUntilNot(skipUntilNot, objType, attrs, label, obj, metadata)); } return(0); }
/// <summary> /// Draws a GUI for editing the given property and returns the updated /// value. This does /// *not* write the updated value to a container. /// </summary> public static object EditPropertyDirect(Rect region, InspectedProperty property, object propertyValue, fiGraphMetadataChild metadataChild) { return EditPropertyDirect(region, property, propertyValue, metadataChild, null); }
private static string DrawItem(Rect position, string item, fiGraphMetadataChild metadata) { return EditorGUI.TextField(position, item); }
public static float EditPropertyHeight(object container, InspectedProperty property, fiGraphMetadataChild metadata) { object propertyValue = property.Read(container); return EditPropertyHeightDirect(property, propertyValue, metadata); }
private static UnityObject DrawItem(Rect position, UnityObject item, fiGraphMetadataChild metadata) { return EditorGUI.ObjectField(position, item, typeof(UnityObject), /*allowSceneObjects:*/true); }
public static void EditProperty(Rect region, object container, InspectedProperty property, fiGraphMetadataChild metadata) { EditorGUI.BeginChangeCheck(); object propertyValue = property.Read(container); object updatedValue = EditPropertyDirect(region, property, propertyValue, metadata, container); if (EditorGUI.EndChangeCheck()) { property.Write(container, updatedValue); // Make sure we propagate the changes up the edit stack. For // example, if this property is on a struct on a struct, then the // top-level struct will not get modified without propagation of // the change check. GUI.changed = true; } }
protected TItem DrawItem(Rect rect, TItem element, fiGraphMetadataChild metadata) { return(_itemEditor.FirstEditor.Edit(rect, GUIContent.none, element, metadata)); }