Skip to content

Commit 5753c7b

Browse files
committed
Update property drawers that support multiple objects, fix NRE
1 parent 67583b7 commit 5753c7b

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

Editor/CustomInspectors/ReadOnlyPropertyAttributeDrawer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Gilzoide.ConditionalObjects.Editor
55
{
6-
[CustomPropertyDrawer(typeof(ReadOnlyPropertyAttribute))]
6+
[CustomPropertyDrawer(typeof(ReadOnlyPropertyAttribute)), CanEditMultipleObjects]
77
public class ReadOnlyPropertyAttributeDrawer : PropertyDrawer
88
{
99
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)

Editor/CustomInspectors/SingleFieldPropertyDrawer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Gilzoide.ConditionalObjects.Editor
55
{
6-
[CustomPropertyDrawer(typeof(ISingleFieldProperty), true)]
6+
[CustomPropertyDrawer(typeof(ISingleFieldProperty), true), CanEditMultipleObjects]
77
public class SingleFieldPropertyDrawer : PropertyDrawer
88
{
99
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)

Runtime/Extensions/PresetExtensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ public static void ExcludeAllProperties(this Preset preset)
1919
public static void GetIncludedProperties(this Preset preset, HashSet<string> set)
2020
{
2121
set.Clear();
22+
if (preset.PropertyModifications == null)
23+
{
24+
return;
25+
}
2226
set.UnionWith(preset.PropertyModifications.Select(prop => prop.propertyPath));
2327
set.UnionWith(preset.PropertyModifications.Select(prop => prop.propertyPath.Split('.', 2)[0]));
2428
}

Runtime/PropertyModifier.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class PropertyModifier : AImportTimeObjectModifier
66
{
77
#if UNITY_EDITOR
88
[Space]
9-
[Tooltip("Properties that should be modified in the imported prefab/scene if the conditions above are met")]
9+
[Tooltip("Target object that will be modified in the imported prefab/scene if the conditions above are met")]
1010
public GameObjectOrComponent Target;
1111

1212
protected override void Apply(bool filtersMatch)

0 commit comments

Comments
 (0)