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
Just thought I'd let you know that your singleton approach for the SteamManager has an issue if the game object has more than one instance of the component.
This code:
if (s_instance != null) {
Destroy(gameObject);
return;
}
destroys the game object, making the s_instance null.
To prevent this, Unity has a nice class attribute you can add to the script:
Hey,
Just thought I'd let you know that your singleton approach for the SteamManager has an issue if the game object has more than one instance of the component.
This code:
destroys the game object, making the s_instance null.
To prevent this, Unity has a nice class attribute you can add to the script:
http://docs.unity3d.com/ScriptReference/DisallowMultipleComponent.html
Of course this is just a minor thing, but I thought I'd share, especially since it's such a simple fix :)
The text was updated successfully, but these errors were encountered: