Skip to content

Commit f053470

Browse files
committed
refactor(UI): 移除界面单实例全局开关
移除 EnableUIFormSingleton 属性及字段,简化 UseSingletonOpenMode 逻辑为仅按类型判断。
1 parent f87b455 commit f053470

3 files changed

Lines changed: 1 addition & 55 deletions

File tree

Runtime/BaseUIManager.cs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -204,22 +204,6 @@ public bool IsEnableUIShowAnimation
204204
set { m_IsEnableUIShowAnimation = value; }
205205
}
206206

207-
[UnityEngine.Scripting.Preserve]
208-
private bool m_EnableUIFormSingleton = true;
209-
210-
/// <summary>
211-
/// 获取或设置是否启用界面单实例打开模式。
212-
/// </summary>
213-
/// <remarks>
214-
/// Gets or sets whether singleton mode is enabled when opening UI forms.
215-
/// </remarks>
216-
[UnityEngine.Scripting.Preserve]
217-
public bool EnableUIFormSingleton
218-
{
219-
get { return m_EnableUIFormSingleton; }
220-
set { m_EnableUIFormSingleton = value; }
221-
}
222-
223207
/// <summary>
224208
/// 是否对指定界面类型采用单实例打开模式。
225209
/// </summary>
@@ -231,7 +215,7 @@ public bool EnableUIFormSingleton
231215
[UnityEngine.Scripting.Preserve]
232216
protected bool UseSingletonOpenMode(Type uiFormType)
233217
{
234-
if (!EnableUIFormSingleton || uiFormType == null)
218+
if (uiFormType == null)
235219
{
236220
return false;
237221
}

Runtime/UI/IUIManager.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,6 @@ public interface IUIManager
8585
/// </remarks>
8686
bool IsEnableUIHideAnimation { get; set; }
8787

88-
/// <summary>
89-
/// 获取或设置是否启用界面单实例打开模式。
90-
/// </summary>
91-
/// <remarks>
92-
/// Gets or sets whether singleton mode is enabled when opening UI forms.
93-
/// </remarks>
94-
bool EnableUIFormSingleton { get; set; }
95-
9688
/// <summary>
9789
/// 获取或设置界面实例对象池对象过期秒数。
9890
/// </summary>

Runtime/UIComponent.cs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,6 @@ public partial class UIComponent : GameFrameworkComponent
103103
[UnityEngine.Scripting.Preserve]
104104
[SerializeField] private bool m_IsEnableUIHideAnimation = false;
105105

106-
/// <summary>
107-
/// 是否启用界面单实例打开模式。
108-
/// </summary>
109-
/// <remarks>
110-
/// Whether to enable singleton mode when opening UI forms.
111-
/// </remarks>
112-
[UnityEngine.Scripting.Preserve]
113-
[SerializeField] private bool m_EnableUIFormSingleton = true;
114-
115106
/// <summary>
116107
/// UI 自动回收间隔时间/秒。
117108
/// </summary>
@@ -295,26 +286,6 @@ public bool IsEnableUIHideAnimation
295286
get { return m_UIManager.IsEnableUIHideAnimation; }
296287
}
297288

298-
/// <summary>
299-
/// 获取或设置是否启用界面单实例打开模式。
300-
/// </summary>
301-
/// <remarks>
302-
/// Gets or sets whether singleton mode is enabled when opening UI forms.
303-
/// </remarks>
304-
[UnityEngine.Scripting.Preserve]
305-
public bool EnableUIFormSingleton
306-
{
307-
get { return m_EnableUIFormSingleton; }
308-
set
309-
{
310-
m_EnableUIFormSingleton = value;
311-
if (m_UIManager != null)
312-
{
313-
m_UIManager.EnableUIFormSingleton = value;
314-
}
315-
}
316-
}
317-
318289
/// <summary>
319290
/// 获取界面组数量。
320291
/// </summary>
@@ -510,7 +481,6 @@ private void Start()
510481
m_UIManager.RecycleInterval = m_RecycleInterval;
511482
m_UIManager.IsEnableUIHideAnimation = m_IsEnableUIHideAnimation;
512483
m_UIManager.IsEnableUIShowAnimation = m_IsEnableUIShowAnimation;
513-
m_UIManager.EnableUIFormSingleton = m_EnableUIFormSingleton;
514484
// m_UIManager.InstancePriority = m_InstancePriority;
515485

516486
m_CustomUIGroupHelper = Helper.CreateHelper(m_UIGroupHelperTypeName, m_CustomUIGroupHelper);

0 commit comments

Comments
 (0)