{"repo":"UnityCommunity/UnitySingleton","free":true,"listed":false,"github":"https://github.com/UnityCommunity/UnitySingleton","clone":"git clone https://github.com/UnityCommunity/UnitySingleton.git","description":"The best way to implement singleton pattern in Unity.","language":"C#","stars":701,"topics":["singleton","singleton-pattern","singleton-standard","singletonpattern","design-patterns","design-pattern","csharp","csharp-code","csharp-library","csharp-script"],"license":"MIT","category":"game-templates","readme_excerpt":"Getting Started Features License Resources Download ----------------------------------- --------------------- ------------------- ----------------------- --------------------- Unity Singleton The best way to implement singleton pattern in Unity. By using this pattern you will be able to define Global variables and classes and use their methods and properties in Global. This pattern is a must-have for most of the games that made using Unity engine. 📖 Learn More about Singleton pattern Features - Works in both Development and Production - Instantiates Singleton objects if they aren't available by Lazy Load - You can configure fields in the inspector for singleton objects in the preload scene Getting Started This package can be added to your project via Git UPM. To add this package, copy: and add it as a git package in the Unity Package Manager by clicking on the \"+\" icon on the top left of the Package Manager Window, and selecting \"Install package from git URL\". Once you have the package installed, you may - Create your own Singleton classes by extending the Generic ✨ Singleton ✨ class. (🚀 Check out the example GameManager in the example \\ Preload scene.) - Attach your singleton classes to a GameManager game object in a \\ Preload scene of your own. - Edit the variables inside the inspector - Run the game and enjoy! Usage Add using UnityCommunity.UnitySingleton; for using the classes. - Use Singleton for plain C# classes. - Use MonoSingleton if you want a Scene-based singleton","default_branch":null,"files":null,"tree":[],"storefront":"/r/UnityCommunity","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/UnityCommunity/UnitySingleton/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}