A sample project explaining the usage of singleton object to hold global game state.
Import the package Unity-Singleton/Package/Unity Singleton.unitypackage from Unity (or) open the project under Unity-Singleton/Source Project/.
- The Singleton_Controller class holds the global game state consistently during scene switches.
- This is explained through the score variable.
- Modify the code to suit your needs.
2018
Unity 2022.3.46f1
© 2018-2024. Developed by Bharath Vishal G (https://github.com/BharathVishal). Thank you. 🙂