Basic
Configureโ
Please, create new Empty Object for your Scene and ะก#-script for that object (On that image is ManagerServices and P101XPBehaviour-script):
Initializationโ
For an initialization you need to subscribe on needed events and call P101XP.GetInstance().Initialize(). That event gets InitResult.
You can do that in Awake() Unity method of P101XPBehaviour:
P101XPBehaviour.cs
private void SdkInitializeHandler(InitResult initResult)
{
}
private static bool isInitialized = false;
void Awake()
{
P101XP.GetInstance().InitializeEvent += SdkInitializeHandler;
if (!isInitialized) {
P101XP.GetInstance().Initialize();
isInitialized = true;
}
}
Please, don't forget to unsubscribe from events in OnDestory() Unity method of P101XPBehaviour:
P101XPBehaviour.cs
void OnDestroy()
{
P101XP.GetInstance().InitializeEvent -= SdkInitializeHandler;
}
InitResultโ
var name | description |
---|---|
is_initialized | bool variable, if is true sdk was successful initialize. |
error_message | string variable, error message of sdk initialisation, if the string is not null |
Methodsโ
For events and method description, please see Methods