A static wrapper class for interfacing platform services such as Steamworks and Oculus Platform. It currently supports entitlement check and achievements.
Note: This functionality is available in v1.1.0 and newer.
TBServiceManager adds support for the TBServices system to your game at runtime.
- At least one platform is enabled in the Core Settings menu
- A service is enabled in the Service Settings menu
- The scene contains a
TBServiceManager by calling
TBServiceManager.Initialize() from one of your scripts at startup, or add the
TBServiceManager script to the same object as
Get the TButt namespace to reference
TBServiceManager in your scripts.
TBServiceManager will do an entitlement check when it initializes in your first scene, and call Unity’s
Application.Quit() if it fails. To override this behavior, you can subscribe to the
TBServiceManager.Events.OnEntitlementCheckComplete event and handle the fail case in your own function.
||Returns the active
||Returns true if the active service has finished initializing (and received startup callbacks if online).|
You can get basic information about the logged in user. This will be expanded in the future.
||Returns the username of the logged in user.|
TBServiceManager uses a string token system to identify achievements. Use the same string tokens that you set up in the Oculus and Steamworks developer dashboards for your game.
||Unlocks the requested achievement (if it is not already unlocked).|
||Returns true if the requested achievement has been unlocked.|
||Returns the total number of achievements.|
||Returns the number of unlocked (true) or locked (false) achievements.|
||Receives results of entitlement check. Subscribing to this event will override default entitlement check behavior (closing the application on fail).|
||Receives the string token for the achievement that was unlocked.|