mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] UI ErrorLog
[+] UI ErrorLog
This commit is contained in:
@@ -6,6 +6,7 @@ namespace TEngine.Editor.Inspector
|
|||||||
internal sealed class UIModuleInspector : GameFrameworkInspector
|
internal sealed class UIModuleInspector : GameFrameworkInspector
|
||||||
{
|
{
|
||||||
private SerializedProperty m_InstanceRoot = null;
|
private SerializedProperty m_InstanceRoot = null;
|
||||||
|
private SerializedProperty m_enableErrorLog = null;
|
||||||
private SerializedProperty m_dontDestroyUIRoot = null;
|
private SerializedProperty m_dontDestroyUIRoot = null;
|
||||||
private SerializedProperty m_UICamera = null;
|
private SerializedProperty m_UICamera = null;
|
||||||
|
|
||||||
@@ -20,6 +21,7 @@ namespace TEngine.Editor.Inspector
|
|||||||
EditorGUI.BeginDisabledGroup(EditorApplication.isPlayingOrWillChangePlaymode);
|
EditorGUI.BeginDisabledGroup(EditorApplication.isPlayingOrWillChangePlaymode);
|
||||||
{
|
{
|
||||||
EditorGUILayout.PropertyField(m_InstanceRoot);
|
EditorGUILayout.PropertyField(m_InstanceRoot);
|
||||||
|
EditorGUILayout.PropertyField(m_enableErrorLog);
|
||||||
EditorGUILayout.PropertyField(m_dontDestroyUIRoot);
|
EditorGUILayout.PropertyField(m_dontDestroyUIRoot);
|
||||||
EditorGUILayout.PropertyField(m_UICamera);
|
EditorGUILayout.PropertyField(m_UICamera);
|
||||||
}
|
}
|
||||||
@@ -40,6 +42,7 @@ namespace TEngine.Editor.Inspector
|
|||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
m_InstanceRoot = serializedObject.FindProperty("m_InstanceRoot");
|
m_InstanceRoot = serializedObject.FindProperty("m_InstanceRoot");
|
||||||
|
m_enableErrorLog = serializedObject.FindProperty("m_enableErrorLog");
|
||||||
m_dontDestroyUIRoot = serializedObject.FindProperty("m_dontDestroyUIRoot");
|
m_dontDestroyUIRoot = serializedObject.FindProperty("m_dontDestroyUIRoot");
|
||||||
m_UICamera = serializedObject.FindProperty("m_UICamera");
|
m_UICamera = serializedObject.FindProperty("m_UICamera");
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace GameLogic
|
namespace TEngine
|
||||||
{
|
{
|
||||||
public class ErrorLogger
|
public class ErrorLogger
|
||||||
{
|
{
|
@@ -1,9 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using Cysharp.Threading.Tasks;
|
using Cysharp.Threading.Tasks;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using TEngine;
|
|
||||||
|
|
||||||
namespace GameLogic
|
namespace TEngine
|
||||||
{
|
{
|
||||||
[Window(UILayer.System)]
|
[Window(UILayer.System)]
|
||||||
class LogUI : UIWindow
|
class LogUI : UIWindow
|
||||||
@@ -32,6 +31,5 @@ namespace GameLogic
|
|||||||
{
|
{
|
||||||
m_textError.text = UserData.ToString();
|
m_textError.text = UserData.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -18,6 +18,8 @@ namespace TEngine
|
|||||||
|
|
||||||
[SerializeField] private bool m_dontDestroyUIRoot = true;
|
[SerializeField] private bool m_dontDestroyUIRoot = true;
|
||||||
|
|
||||||
|
[SerializeField] private bool m_enableErrorLog = true;
|
||||||
|
|
||||||
[SerializeField] private Camera m_UICamera = null;
|
[SerializeField] private Camera m_UICamera = null;
|
||||||
|
|
||||||
private readonly List<UIWindow> _stack = new List<UIWindow>(100);
|
private readonly List<UIWindow> _stack = new List<UIWindow>(100);
|
||||||
@@ -61,6 +63,11 @@ namespace TEngine
|
|||||||
|
|
||||||
m_InstanceRoot.gameObject.layer = LayerMask.NameToLayer("UI");
|
m_InstanceRoot.gameObject.layer = LayerMask.NameToLayer("UI");
|
||||||
UIRootStatic = m_InstanceRoot;
|
UIRootStatic = m_InstanceRoot;
|
||||||
|
|
||||||
|
if (m_enableErrorLog)
|
||||||
|
{
|
||||||
|
ErrorLogger errorLogger = new ErrorLogger();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDestroy()
|
private void OnDestroy()
|
||||||
|
Reference in New Issue
Block a user