Skip to main content

Quick Start

Quick Start

1. Import the SDK Package

Import the provided tudada-unity-client-v0.1.5-hotfix0420.unitypackage file in the Unity Editor. (→ Detailed Installation Guide)

2. Use APIs in C# Code

using Tudada;

public class MyGame : MonoBehaviour
{
void Start()
{
if (!TudadaSDK.Instance.IsAvailable())
{
Debug.LogError("TudadaSDK is not available");
return;
}

// Login
TudadaSDK.Instance.Login(
onSuccess: (result) => {
Debug.Log("Login code: " + result.code);
Debug.Log("User ID: " + result.userId);
},
onFail: (err) => Debug.LogError("Login failed: " + err)
);
}
}

3. Apply SDK After WebGL Build

After building with Unity WebGL, add the TudadaSDK script to the generated index.html. (→ Detailed Setup Guide)