Exemplo n.º 1
0
 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);
			}
		}
Exemplo n.º 3
0
 private void Awake()
 {
     if (instance == null)
     {
         AwakeOnce();
         instance = this;
         UnityEngine.Object.DontDestroyOnLoad(this);
     }
     else if (instance != this)
     {
         UnityEngine.Object.Destroy(base.gameObject);
     }
 }
Exemplo n.º 4
0
 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");
     }
 }
Exemplo n.º 5
0
        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);
            }
        }
Exemplo n.º 6
0
 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());
     }
 }
Exemplo n.º 7
0
 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");
     }
 }
Exemplo n.º 8
0
        private static void HandleException(object sender, UnhandledExceptionEventArgs eArgs)
        {
            Exception exceptionObject = (Exception)eArgs.ExceptionObject;

            CrashlyticsInit.HandleLog(exceptionObject.Message.ToString(), exceptionObject.StackTrace.ToString(), (LogType)4);
        }
Exemplo n.º 9
0
 private void AwakeOnce()
 {
     CrashlyticsInit.RegisterExceptionHandlers();
 }