コード例 #1
0
        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);
        }
コード例 #2
0
		bool IsParentOf(ItemDrawer drawer)
		{
			return drawer.Parents.Contains(this);
		}
コード例 #3
0
		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);
		}
コード例 #4
0
 bool IsParentOf(ItemDrawer drawer)
 {
     return(drawer.Parents.Contains(this));
 }