You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across this when I searched for some sort of Singleton gameobject pattern which is persistent across scenes. I implemented it just the way you did, but had the problem that my object was created several times when I switched back and forth between scenes. After reading this I ended up removing the OnDestroyed()-method which clears the _instance field and added this to the Awake-method:
`void Awake () {
Hi - I seem to be getting the same behaviour using the latest version here on github, not sure which part of it makes it do this. Here's a screenshot after loading between a few scenes -- showing multiple instances of that object: https://i.imgur.com/1qaXJQH.png
Hi,
I came across this when I searched for some sort of Singleton gameobject pattern which is persistent across scenes. I implemented it just the way you did, but had the problem that my object was created several times when I switched back and forth between scenes. After reading this I ended up removing the OnDestroyed()-method which clears the _instance field and added this to the Awake-method:
`void Awake () {
Maybe this is an issue for you, too (frankly, I don't know why the OnDestroy()-method was called on my gameobject)
The text was updated successfully, but these errors were encountered: