Can EventReferences be explicitly set to nothing so it doesn't give a warning?

When an event reference is left blank in unity, the inspector shows a warning, which is fair enough as a measure to avoid bugs, but sometimes not having an event specified for a given field isn’t an error. Is there something one can put in the event reference field to suppress the warning but still set the internal GUID to nil?


Are you using a Studio Event Emitter or just and public FMODUnity.EventReference?

If you wish to remove the warning completely then you can change some code in the EventRefDrawer.cs. However, this is not recommended. If you are using an EventReference you could make it private so that it does not show in the editor.

Hope this helps!

As per the title of my post, I’m using an EventReference in my own MonoBehaviour class, yes, not the builtin event emitter. Making the event reference private wouldn’t achieve anything good since I’d then lose the ability to set its value in the inspector, which is the entire point of having it in my class in the first place.

Point is, I recognize that the warning is there for a good reason, I just really wish there was a way to suppress it only in cases when a lack of a sound event is desired.


Thank you for the information.

You can hide the warning by commenting the line 218 in EventRefDrawer.cs.