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
We need some data like the current level, number of levels to be consistent across the scenes meaning that it should persist even if the scene has changed.
The text was updated successfully, but these errors were encountered:
Added a static class dataHolder in the assets that has all static variable/ methods. Only one copy of this data gets created once the application is started and remains until the end of execution. Manipulating the class data from other classes as needed.
Also made the sceneManager class static as it need not be assigned to any of the objects.
Cannot have any monobehaviour methods like start or update in this class.
(An alternative to this approach is to use an empty gameobject with a script with needed data. The gameobject needs to be used with donotdestroyonload. Can use monobehaviour methods.)
We need some data like the current level, number of levels to be consistent across the scenes meaning that it should persist even if the scene has changed.
The text was updated successfully, but these errors were encountered: