static public void OnEdit(PEExposedPropertiesEditor editor, ItemDrawer propertyToEdit) { var lr = GUILayoutUtility.GetLastRect(); if (lr.min == Vector2.zero) { lr.center = Event.current.mousePosition; } var p = propertyToEdit.ExposedData.First() as ExposedProperty; lr.center = GUIUtility.GUIToScreenPoint(lr.center); PEPropertyPickerWindow.OnPropertyPickerDelegate onChanged = property => { var newProperty = p; newProperty.Label = property.GetDisplayName(); newProperty.PropertyPath = property.propertyPath; newProperty.Target = property.serializedObject.targetObject; editor.Build(true); }; EditorApplication.delayCall += () => PEPropertyPickerWindow.Show(editor.targets[0].gameObject, onChanged, lr, null, propertyToEdit.Property); }
bool IsParentOf(ItemDrawer drawer) { return drawer.Parents.Contains(this); }
static public void OnEdit(PEExposedPropertiesEditor editor, ItemDrawer propertyToEdit) { var lr = GUILayoutUtility.GetLastRect(); if (lr.min == Vector2.zero) lr.center = Event.current.mousePosition; var p = propertyToEdit.ExposedData.First() as ExposedProperty; lr.center = GUIUtility.GUIToScreenPoint(lr.center); PEPropertyPickerWindow.OnPropertyPickerDelegate onChanged = property => { var newProperty = p; newProperty.Label = property.GetDisplayName(); newProperty.PropertyPath = property.propertyPath; newProperty.Target = property.serializedObject.targetObject; editor.Build(true); }; EditorApplication.delayCall += () => PEPropertyPickerWindow.Show(editor.targets[0].gameObject, onChanged, lr, null, propertyToEdit.Property); }
bool IsParentOf(ItemDrawer drawer) { return(drawer.Parents.Contains(this)); }