Get Started
Initialization
To initialize the SDK, subscribe to the necessary events (notably InitializeEvent for initialization results) and call:
P101XP.GetInstance().Initialize();
The initialization event returns an InitResult object (see InitResult section below).
A typical setup is to perform SDK initialization inside the Awake() method of your P101XPBehaviour component:
P101XPBehaviour.cs
private static bool isInitialized = false;
private void SdkInitializeHandler(InitResult initResult)
{
// Handle initialization result here
}
private void Awake()
{
P101XP.GetInstance().InitializeEvent += SdkInitializeHandler;
if (!isInitialized)
{
P101XP.GetInstance().Initialize();
isInitialized = true;
}
}
InitResult
| Field name | Description |
|---|---|
| initialized | bool — true if the SDK was successfully initialized. |
| error | string — error message if initialization failed. null means no error. |