Debugging
Check SDK State
Debug.Log($"Initialized: {GameRebellion.IsInitialized}");
Debug.Log($"State: {GameRebellion.GetState()}");
Debug.Log($"Last Error: {GameRebellion.GetLastError()}");
Expected after successful init:
IsInitialized=trueGetState()=SdkState.Ready
Enable Log Draining
The SDK buffers logs in the native core. Surface them in the Unity Console:
gameObject.AddComponent<GRLogDrainer>();
GRLogDrainer periodically calls DrainAndLogSDKLogs() and prints native logs with the [GRC] prefix.
GRLogDrainer Configuration
| Field | Default | Description |
|---|---|---|
drainInterval | 1.0f | Seconds between drain calls |
enableLogDraining | true | Enable/disable log draining |
Force Flush
During testing, force-send all buffered events:
GameRebellion.Flush();
GRMetricsCollector
The auto-created metrics collector can be configured for debugging:
| Field | Default | Description |
|---|---|---|
trackFPS | true | Enable FPS tracking |
trackMemory | true | Enable memory tracking |
logMetrics | false | Print metrics to console |
logInterval | 5f | Seconds between console logs |
Set logMetrics = true during development to see FPS and memory values in the console.
Network Debugging
// Force offline mode (events are queued locally)
GameRebellion.SetNetworkOnline(false);
// Re-enable network (queued events are sent)
GameRebellion.SetNetworkOnline(true);