public string GetVersion() { string sdkVersion = ""; try { sdkVersion = s_GameSDK.Call <string>("getVersion"); } catch (Exception) { GameSDKLog.Debug("[Exception] GameSDK.getVersion() failed!"); } return(sdkVersion); }
public bool SetLevelWithScene(string scene, int cpu, int gpu) { bool success = false; try { success = s_GameSDK.Call <bool>("setLevelWithScene", scene, cpu, gpu); GameSDKLog.Debug($"setLevelWithScene({scene}, {cpu}, {gpu}) -> {success}"); } catch (Exception) { GameSDKLog.Debug($"[Exception] GameSDK.setLevelWithScene({scene}, {cpu}, {gpu}) failed!"); } return(success); }
void onHighTempWarning(int warningLevel) { GameSDKLog.Debug($"Listener: onHighTempWarning(warningLevel={warningLevel})"); if (warningLevel == 0) { SustainedPerformanceWarningEvent(PerformanceWarningLevel.NoWarning); } else if (warningLevel == 1) { SustainedPerformanceWarningEvent(PerformanceWarningLevel.ThrottlingImminent); } else if (warningLevel == 2) { SustainedPerformanceWarningEvent(PerformanceWarningLevel.Throttling); } }
public int GetGpuJTLevel() { int currentGpuTempLevel = -1; try { currentGpuTempLevel = AndroidJNI.CallIntMethod(s_GameSDKRawObjectID, s_GetGpuJTLevelID, null); if (AndroidJNI.ExceptionOccurred() != IntPtr.Zero) { AndroidJNI.ExceptionDescribe(); AndroidJNI.ExceptionClear(); } } catch (Exception) { GameSDKLog.Debug("[Exception] GameSDK.getGpuJTLevel() failed!"); } return(currentGpuTempLevel); }
public void UnregisterListener() { bool success = true; try { GameSDKLog.Debug("setListener(null)"); success = s_GameSDK.Call <bool>("setListener", (Object)null); } catch (Exception) { success = false; } if (!success) { GameSDKLog.Debug("setListener(null) failed!"); } }
public double GetGpuFrameTime() { double gpuFrameTime = -1.0; try { gpuFrameTime = AndroidJNI.CallDoubleMethod(s_GameSDKRawObjectID, s_GetGpuFrameTimeID, null); if (AndroidJNI.ExceptionOccurred() != IntPtr.Zero) { AndroidJNI.ExceptionDescribe(); AndroidJNI.ExceptionClear(); } } catch (Exception) { GameSDKLog.Debug("[Exception] GameSDK.getGpuFrameTime() failed!"); } return(gpuFrameTime); }
public bool RegisterListener() { bool success = false; try { success = s_GameSDK.Call <bool>("setListener", this); } catch (Exception) { success = false; } if (!success) { GameSDKLog.Debug("failed to register listener"); } return(success); }
public void Terminate() { UnregisterListener(); bool success = true; try { var packageName = Application.identifier; GameSDKLog.Debug($"GameSDK.finalize({packageName})"); success = s_GameSDK.Call <bool>("finalize", packageName); } catch (Exception) { success = false; } if (!success) { GameSDKLog.Debug("GameSDK.finalize() failed!"); } }
public bool Initialize() { bool isInitialized = false; try { isInitialized = s_GameSDK.Call <bool>("initialize"); if (isInitialized) { isInitialized = RegisterListener(); } else { GameSDKLog.Debug("GameSDK.initialize() failed!"); } } catch (Exception) { GameSDKLog.Debug("[Exception] GameSDK.initialize() failed!"); } return(isInitialized); }
void onReleasedByTimeout() { GameSDKLog.Debug("Listener: onReleasedByTimeout()"); SustainedPerformanceTimeoutEvent(); }