Unity Editor Simulation
Unity Editor Simulation
You can test all APIs in the Unity Editor without a WebGL build.
Behavior
| API | Editor Behavior |
|---|---|
| Auth | Returns mock login code and user info |
| Storage | Simulated with PlayerPrefs (key prefix: TudadaSDK_) |
| TudadaStore | Simulated with PlayerPrefs (key prefix: TudadaStore_) |
| System | Returns Unity screen info + default values |
| Vibration | Console log output (no actual vibration) |
| Keyboard | Console log output |
| Clipboard | Uses system clipboard |
| Ad | Instant success response, simulates ad completion |
| Accelerometer | Instant success response (acceleration data requires manual trigger) |
| Lifecycle | Console 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);
}
);