UnityCommunity / UnitySingleton

The best way to implement singleton pattern in Unity.
https://en.wikipedia.org/wiki/Singleton_pattern
MIT License
459 stars 61 forks source link

Unity completely crashes when trying to access singleton methods or properties #11

Open janvacek opened 6 months ago

janvacek commented 6 months ago

Hi,

whenever I enter play mode and any of my script is trying to call something from singletons, whole unity crashes without any error log.

Is there any limitations which I would need to know before using these singletons scripts?

janvacek commented 6 months ago

it was because of recursion - https://github.com/UnityCommunity/UnitySingleton/blob/main/Assets/Scripts/Runtime/Singleton.cs#L47