VRHub #
The main API class for the VRenaissance Hub.
Definition #
Namespace: VRRSS.SDK.HubAPI
Type: Static Class
Inheritance: -
Implements the API for the VRenaissance Hub.
public static class VRHub
Events #
LicenseVerificationCompleted #
Type: LicenseEventHandler
Description: It is triggered when a callback is received from the plugin after the license verification is completed. Transmits the verification results as LicenseStatus. It is triggered every 5 minutes after initialization in the plugin. For initialization, use InitializeGameWithLicense.
public static event LicenseEventHandler LicenseVerificationCompleted;
Note
This event is typically called in a non-main thread of Unity. When working with this event, you may encounter an error like ...can only be called from the main thread. This usually happens when working with Unity API components. In such cases, you should use Dispatcher.
Methods #
SendCommand #
Description: Sends a custom command to the VRenaissance Hub.
public static void SendCommand(string command)
Parameters #
command #
Type: string
Description: Command.
Usage example #
SendCommand("window?command=maximize");
InitializeGame #
Description: Initializes the game in the VRenaissance Hub by its ID.
csharp public static bool InitializeGame(string gameId)
Parameters #
gameId #
Type: string
Description: The ID of the game.
Result #
Type: bool
Description: The success of the initialization of the game.
Usage example #
bool isGameInitialized = InitializeGame("com.stvdev.netoa");
InitializeGameWithLicense #
Description: Initializes the game in the VRenaissance Hub by its ID and starts the license verification cycle. The license check will be performed every 5 minutes until the end of the gameplay. To process the verification results, use LicenseVerificationCompleted.
csharp public static void InitializeGameWithLicense(string gameId)
Parameters #
gameId #
Type: string
Description: The ID of the game.
Usage example #
InitializeGameWithLicense("com.stvdev.netoa");
StopLicenseVerification #
Description: Stops the license verification cycle if it is running. When stopped, LicenseVerificationCompleted will be invoked with the LicenseStatus.Canceled.
public static void StopLicenseVerification()
Usage example #
StopLicenseVerification()
ShowMessage #
Description: Displays a dialog box with a message in the VRenaissance Hub.
public static void ShowMessage(string body, string header = "", MessageType type = MessageType.None)
Parameters #
body #
Type: string
Description: The text of the message.
header #
Type: string
Description: The title of the message.
Default: ""
type #
Type: MessageType
Description: The type of message.
Default: MessageType.None
Usage example #
ShowMessage("Something went wrong.", "Oops...", MessageType.Error);