Skip to main content

API Overview

Basic Usage

All APIs are accessed through TudadaSDK.Instance:

using Tudada;

// Check SDK availability
if (TudadaSDK.Instance.IsAvailable())
{
// Call API
TudadaSDK.Instance.Login(
onSuccess: (result) => { ... },
onFail: (err) => { ... }
);
}

TudadaSDK.Instance is a singleton that automatically creates a TudadaSDKHandler GameObject on first access. Do not rename this GameObject.

Common Patterns

All asynchronous APIs accept onSuccess and onFail callbacks:

TudadaSDK.Instance.SomeApi(
// Required/optional parameters
param: value,

// Called on success (optional)
onSuccess: (result) => {
Debug.Log("Success: " + result.errMsg);
},

// Called on failure (optional)
onFail: (errMsg) => {
Debug.LogError("Failed: " + errMsg);
}
);