UnitySingleton
UnitySingleton copied to clipboard
HasInstance boolean for unsubscribing from events in OnDisable/OnDestroy
Fixes the issue brought up in #17
Changes
- Added a
HasInstanceboolean in theMonoSingleton<T>andSingleton<T>scripts. - Updated the
README.mdwith a "Common Issues" section which lists why this error happens, and how to fix it
I ran into this error when making my own game using this package and trying to unsubscribe from events. I tried the fix described in the response and it worked, but I saw there was no fix in the project for it. I would have to add it to every script I made if I didn't fix it, so here we are.