PICO Platform Unity SDK
CoreService Class Reference

Static Public Member Functions

static bool IsInitialized ()
 Gets whether the Platform SDK has been initialized. More...
 
static string GetAppID (string appId=null)
 Gets the app ID for the current app. More...
 
static Task< PlatformInitializeResult > AsyncInitialize (string appId=null)
 Initializes the Platform SDK asynchronously. More...
 
static void Initialize (string appId=null)
 Initializes the Platform SDK synchronously. More...
 
static Task< GameInitializeResult > GameInitialize (string accessToken)
 Initializes game-related modules, such as room, matchmaking, and network. More...
 
static Task< GameInitializeResult > GameInitialize ()
 Initializes modules without token related with game, such as room, matchmaking, and net. More...
 
static bool GameUninitialize ()
 Uninitializes game-related modules, such as room, matchmaking, and network. More...
 

Static Public Attributes

static bool Initialized = false
 
static string NotInitializedError = "Platform SDK has not been initialized!"
 

Member Function Documentation

◆ IsInitialized()

static bool IsInitialized ( )
static

Gets whether the Platform SDK has been initialized.

Returns
  • true: initialized
  • false: not initialized

◆ GetAppID()

static string GetAppID ( string  appId = null)
static

Gets the app ID for the current app.

Returns
The app ID.
Exceptions
UnityExceptionIf the app ID cannot be found, this exception will be thrown.

◆ AsyncInitialize()

static Task< PlatformInitializeResult > AsyncInitialize ( string  appId = null)
static

Initializes the Platform SDK asynchronously.

Parameters
appIdThe app ID for the Platform SDK. If not provided, Unity editor configuration will be applied.
Returns
The initialization result.
Exceptions
UnityExceptionIf the input app ID is null or empty or if the initialization fails, this exception will be thrown.
NotImplementedExceptionIf the current platform is not supported, this exception will be thrown.

◆ Initialize()

static void Initialize ( string  appId = null)
static

Initializes the Platform SDK synchronously.

Parameters
appIdThe app ID for the Platform SDK. If not provided, Unity editor configuration will be applied.
Exceptions
NotImplementedExceptionIf the current platform is not supported, this exception will be thrown.
UnityExceptionIf the initialization fails, this exception will be thrown.

◆ GameInitialize() [1/2]

Task< GameInitializeResult > GameInitialize ( string  accessToken)
static

Initializes game-related modules, such as room, matchmaking, and network.

Parameters
accessTokenThe access token of Platform SDK. You can get the access token by calling UserService.GetAccessToken().

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ GameInitialize() [2/2]

Task< GameInitializeResult > GameInitialize ( )
static

Initializes modules without token related with game, such as room, matchmaking, and net.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ GameUninitialize()

static bool GameUninitialize ( )
static

Uninitializes game-related modules, such as room, matchmaking, and network.

Returns
  • true: success
  • false: failure