private static void HandleLog(string message, string stackTraceString, LogType type) { if (type != 4) { return; } Utils.Log(CrashlyticsInit.kitName, "Recording exception: " + message); Utils.Log(CrashlyticsInit.kitName, "Exception stack trace: " + stackTraceString); string[] messageParts = CrashlyticsInit.getMessageParts(message); Fabric.Crashlytics.Crashlytics.RecordCustomException(messageParts[0], messageParts[1], stackTraceString); }
void Awake () { // This singleton pattern ensures AwakeOnce() is only called once even when the scene // is reloaded (loading scenes destroy previous objects and wake up new ones) if (instance == null) { AwakeOnce (); instance = this; DontDestroyOnLoad(this); } else if (instance != this) { Destroy(this.gameObject); } }
private void Awake() { if (instance == null) { AwakeOnce(); instance = this; UnityEngine.Object.DontDestroyOnLoad(this); } else if (instance != this) { UnityEngine.Object.Destroy(base.gameObject); } }
private static void RegisterExceptionHandlers() { if (CrashlyticsInit.IsSDKInitialized()) { Utils.Log(CrashlyticsInit.kitName, "Registering exception handlers"); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CrashlyticsInit.HandleException); // ISSUE: method pointer Application.add_logMessageReceived(new Application.LogCallback((object)null, __methodptr(HandleLog))); } else { Utils.Log(CrashlyticsInit.kitName, "Did not register exception handlers: Crashlytics SDK was not initialized"); } }
void Awake() { // This singleton pattern ensures AwakeOnce() is only called once even when the scene // is reloaded (loading scenes destroy previous objects and wake up new ones) if (instance == null) { AwakeOnce(); instance = this; DontDestroyOnLoad(this); } else if (instance != this) { Destroy(this.gameObject); } }
private void Awake() { if (Object.op_Equality((Object)CrashlyticsInit.instance, (Object)null)) { this.AwakeOnce(); CrashlyticsInit.instance = this; Object.DontDestroyOnLoad((Object)this); } else { if (!Object.op_Inequality((Object)CrashlyticsInit.instance, (Object)this)) { return; } Object.Destroy((Object)((Component)this).get_gameObject()); } }
private static void RegisterExceptionHandlers() { if (CrashlyticsInit.IsSDKInitialized()) { Utils.Log(CrashlyticsInit.kitName, "Registering exception handlers"); AppDomain currentDomain = AppDomain.CurrentDomain; if (CrashlyticsInit.__f__mg_cache0 == null) { CrashlyticsInit.__f__mg_cache0 = new UnhandledExceptionEventHandler(CrashlyticsInit.HandleException); } currentDomain.UnhandledException += CrashlyticsInit.__f__mg_cache0; if (CrashlyticsInit.__f__mg_cache1 == null) { CrashlyticsInit.__f__mg_cache1 = new Application.LogCallback(CrashlyticsInit.HandleLog); } Application.logMessageReceived += CrashlyticsInit.__f__mg_cache1; } else { Utils.Log(CrashlyticsInit.kitName, "Did not register exception handlers: Crashlytics SDK was not initialized"); } }
private static void HandleException(object sender, UnhandledExceptionEventArgs eArgs) { Exception exceptionObject = (Exception)eArgs.ExceptionObject; CrashlyticsInit.HandleLog(exceptionObject.Message.ToString(), exceptionObject.StackTrace.ToString(), (LogType)4); }
private void AwakeOnce() { CrashlyticsInit.RegisterExceptionHandlers(); }