Skip to main content

Unity Editor Simulation

Unity Editor Simulation​

You can test all APIs in the Unity Editor without a WebGL build.

Behavior​

APIEditor Behavior
AuthReturns mock login code and user info
StorageSimulated with PlayerPrefs (key prefix: TudadaSDK_)
TudadaStoreSimulated with PlayerPrefs (key prefix: TudadaStore_)
SystemReturns Unity screen info + default values
VibrationConsole log output (no actual vibration)
KeyboardConsole log output
ClipboardUses system clipboard
AdInstant success response, simulates ad completion (the reward slot list returns a rewarded slot and an interstitial slot; the interstitial slot reports isEnded = false)
AccelerometerInstant success response (acceleration data requires manual trigger)
LifecycleConsole log output

IsAvailable() in the Editor​

In the Editor, IsAvailable() returns false, but calling each API will automatically execute mock behavior. Therefore, the following code works in both the Editor and WebGL:

// Works as mock in Editor too
TudadaSDK.Instance.Login(
onSuccess: (result) => {
// Editor: returns mock code
// WebGL: returns actual login code
Debug.Log("Code: " + result.code);
}
);