[Advice] Using a button to quit during Unity editor runtime

This is a small section of code that can be placed in any quit/exit button. It allows the button to function during runtime in Unity editor.

https://pastebin.com/tCa12QKA

Here is a link that explains the #if statement

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-if

I hope this is helpful to anyone.

4 Likes

Thanks for the advice, should be very helpful! :smile: