mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
UIModule
This commit is contained in:
@@ -6,6 +6,7 @@ namespace TEngine.Editor.Inspector
|
||||
internal sealed class UIModuleInspector : GameFrameworkInspector
|
||||
{
|
||||
private SerializedProperty m_InstanceRoot = null;
|
||||
private SerializedProperty m_dontDestroyUIRoot = null;
|
||||
private SerializedProperty m_UICamera = null;
|
||||
private SerializedProperty m_UIGroups = null;
|
||||
|
||||
@@ -23,6 +24,7 @@ namespace TEngine.Editor.Inspector
|
||||
EditorGUI.BeginDisabledGroup(EditorApplication.isPlayingOrWillChangePlaymode);
|
||||
{
|
||||
EditorGUILayout.PropertyField(m_InstanceRoot);
|
||||
EditorGUILayout.PropertyField(m_dontDestroyUIRoot);
|
||||
EditorGUILayout.PropertyField(m_UICamera);
|
||||
m_UIWindowHelperInfo.Draw();
|
||||
m_UIGroupHelperInfo.Draw();
|
||||
@@ -50,6 +52,7 @@ namespace TEngine.Editor.Inspector
|
||||
private void OnEnable()
|
||||
{
|
||||
m_InstanceRoot = serializedObject.FindProperty("m_InstanceRoot");
|
||||
m_dontDestroyUIRoot = serializedObject.FindProperty("m_dontDestroyUIRoot");
|
||||
m_UICamera = serializedObject.FindProperty("m_UICamera");
|
||||
m_UIGroups = serializedObject.FindProperty("m_UIGroups");
|
||||
|
||||
|
@@ -24,6 +24,8 @@ namespace TEngine
|
||||
private const int DefaultPriority = 0;
|
||||
|
||||
[SerializeField] private Transform m_InstanceRoot = null;
|
||||
|
||||
[SerializeField] private bool m_dontDestroyUIRoot = true;
|
||||
|
||||
[SerializeField] private Camera m_UICamera = null;
|
||||
|
||||
@@ -88,6 +90,10 @@ namespace TEngine
|
||||
m_InstanceRoot.SetParent(gameObject.transform);
|
||||
m_InstanceRoot.localScale = Vector3.one;
|
||||
}
|
||||
else if (m_dontDestroyUIRoot)
|
||||
{
|
||||
DontDestroyOnLoad(m_InstanceRoot.parent);
|
||||
}
|
||||
|
||||
m_InstanceRoot.gameObject.layer = LayerMask.NameToLayer("UI");
|
||||
UIRootStatic = m_InstanceRoot;
|
||||
|
Reference in New Issue
Block a user