If I select a prefab that uses this property and then multi-select more prefabs that also use this property they will get their own “vfx” value overridden by the first selection’s value.
I just noticed exactly this problem on our project. It is likely a bug introduced in the most recent versions of Unity. I made a quick workaround using SerializedProperty.hasMultipleDifferentValues, which tells me when multi-editing is taking place. When that’s the case, I just switch to default property drawing using EditorGUI.PropertyField()
This is still a problem. I worked around it like this:
[CustomPropertyDrawer(typeof(Layer))]
class LayerDrawer : PropertyDrawer {
public override void OnGUI(
Rect position,
SerializedProperty property,
GUIContent label
) {
property.Next(true);
var nextValue = EditorGUI.LayerField(position, label, property.intValue);
if (nextValue != property.intValue) {
property.intValue = nextValue;
}
}
}
}
This way only if the user actually changes the value will it be assigned, which in the case of a multi-selection will affect all selected objects as expected.