UGUI OnEventListener defaults to Runtime Only

Hey Guys,

Is there any good reasoning behind why the default value of an event listener of a Button or any other UI element is set to Runtime only?

Surely it would save everyone a lot of time if it defaulted to Editor & Runtime?

Or perhaps the reasoning is because for a build they should be set to Runtime only?

Could somebody please explain this to me?

Thanks

The default for an event should be Runtime only, this makes sense in 99% of cases. Editor means the event can be fired when the game is not being played, this means any changes applied by the event will be saved to the scene, not something you normally want. Runtime means the event will only be fired when the game is playing. Perhaps you have confused the terminology and took Editor to mean runtime mode in the editor?

Yes that is exactly what I did. How stupid. I was executing a UI script in Editor and got confuddled… Thanks

1 Like