ExceptionToLog.cs 396 B

123456789101112131415161718192021222324
  1. using UnityEngine;
  2. using System;
  3. namespace GraphProcessor
  4. {
  5. public static class ExceptionToLog
  6. {
  7. public static void Call(Action a)
  8. {
  9. #if UNITY_EDITOR
  10. try
  11. {
  12. #endif
  13. a?.Invoke();
  14. #if UNITY_EDITOR
  15. }
  16. catch (Exception e)
  17. {
  18. Debug.LogException(e);
  19. }
  20. #endif
  21. }
  22. }
  23. }