XOpencoding.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using System.Diagnostics;
  2. using UnityEngine;
  3. namespace XGame.Framework
  4. {
  5. public static class XOpencoding
  6. {
  7. private static GameObject _debugConsoleGO;
  8. [Conditional(MacroDefine.DEBUG), Conditional(MacroDefine.PROFILER)]
  9. public static void Initialize()
  10. {
  11. //加载并且实例预制
  12. _debugConsoleGO = Object.Instantiate(Resources.Load<GameObject>("DebugConsole"));
  13. Opencoding.LogHistory.LogHandler.ConsoleVisibleChangedEvent += OnConsoleVisibleChanged;
  14. }
  15. [Conditional(MacroDefine.DEBUG), Conditional(MacroDefine.PROFILER)]
  16. public static void Dispose()
  17. {
  18. Object.DestroyImmediate(_debugConsoleGO);
  19. _debugConsoleGO = null;
  20. Opencoding.LogHistory.LogHandler.ConsoleVisibleChangedEvent -= OnConsoleVisibleChanged;
  21. }
  22. /// <summary>
  23. /// DebugConsole事件
  24. /// </summary>
  25. /// <param name="isVisible"></param>
  26. private static void OnConsoleVisibleChanged(bool isVisible)
  27. {
  28. //冻结热区穿透
  29. //FingerGestureUtility.Freeze(isVisible);
  30. }
  31. }
  32. }