If you already have a method of maintaining global state in your game you may wish to replace this with your own method. As usual refrain from interacting with the SteamManager from Awake() or OnDestroy() in other scripts as the execution order is not guaranteed. With this pattern you can use the SteamManager from any scene in your game without having to manually place a SteamManager GameObject in each one. We use a “Self-Creating Persistent Singleton” to accomplish this. ![]() This involves some rather heavy logic to integrate with Unity’s GameObject system. The SteamManager script relies on being created once and persisting throughout the duration of the game. BoilerplateĪll of the code below is wrapped within a MonoBehavior class so that it can be added to a GameObject. You will likely wish to make changes to the SteamManager script yourself and understanding why it does what it does is an important step to fully mastering Steamworks. It provides some basic logic to setup and maintain the connection with Steam. The SteamManager script is what we consider the ‘usermode’ code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |