Skip to content

Commit

Permalink
同步最新REF改动
Browse files Browse the repository at this point in the history
  • Loading branch information
LiShengYang-yiyi committed Oct 17, 2024
1 parent 3402e5e commit 2b9ad10
Show file tree
Hide file tree
Showing 21 changed files with 61 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void Dispose()
{
OnEventInvokeType = null;
UIEventParamDelegate = null;
m_Trigger = null;
m_Trigger = default;
if (m_UIEventList == null || m_UIEventNode == null) return;
m_UIEventList.Remove(m_UIEventNode);
m_UIEventNode = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void Dispose()
{
OnEventInvokeType = null;
UIEventParamDelegate = null;
m_Trigger = null;
m_Trigger = default;
if (m_UIEventList == null || m_UIEventNode == null) return;
m_UIEventList.Remove(m_UIEventNode);
m_UIEventNode = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void Dispose()
{
OnEventInvokeType = null;
UIEventParamDelegate = null;
m_Trigger = null;
m_Trigger = default;
if (m_UIEventList == null || m_UIEventNode == null) return;
m_UIEventList.Remove(m_UIEventNode);
m_UIEventNode = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void Dispose()
{
OnEventInvokeType = null;
UIEventParamDelegate = null;
m_Trigger = null;
m_Trigger = default;
if (m_UIEventList == null || m_UIEventNode == null) return;
m_UIEventList.Remove(m_UIEventNode);
m_UIEventNode = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void Dispose()
{
OnEventInvokeType = null;
UIEventParamDelegate = null;
m_Trigger = null;
m_Trigger = default;
if (m_UIEventList == null || m_UIEventNode == null) return;
m_UIEventList.Remove(m_UIEventNode);
m_UIEventNode = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void Dispose()
{
OnEventInvokeType = null;
UIEventParamDelegate = null;
m_Trigger = null;
m_Trigger = default;
if (m_UIEventList == null || m_UIEventNode == null) return;
m_UIEventList.Remove(m_UIEventNode);
m_UIEventNode = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void Dispose()
{
OnEventInvokeType = null;
UITaskEventParamDelegate = null;
m_Trigger = null;
m_Trigger = default;
if (m_UITaskEventList == null || m_UITaskEventNode == null) return;
m_UITaskEventList.Remove(m_UITaskEventNode);
m_UITaskEventNode = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void Dispose()
{
OnEventInvokeType = null;
UITaskEventParamDelegate = null;
m_Trigger = null;
m_Trigger = default;
if (m_UITaskEventList == null || m_UITaskEventNode == null) return;
m_UITaskEventList.Remove(m_UITaskEventNode);
m_UITaskEventNode = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void Dispose()
{
OnEventInvokeType = null;
UITaskEventParamDelegate = null;
m_Trigger = null;
m_Trigger = default;
if (m_UITaskEventList == null || m_UITaskEventNode == null) return;
m_UITaskEventList.Remove(m_UITaskEventNode);
m_UITaskEventNode = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void Dispose()
{
OnEventInvokeType = null;
UITaskEventParamDelegate = null;
m_Trigger = null;
m_Trigger = default;
if (m_UITaskEventList == null || m_UITaskEventNode == null) return;
m_UITaskEventList.Remove(m_UITaskEventNode);
m_UITaskEventNode = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void Dispose()
{
OnEventInvokeType = null;
UITaskEventParamDelegate = null;
m_Trigger = null;
m_Trigger = default;
if (m_UITaskEventList == null || m_UITaskEventNode == null) return;
m_UITaskEventList.Remove(m_UITaskEventNode);
m_UITaskEventNode = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void Dispose()
{
OnEventInvokeType = null;
UITaskEventParamDelegate = null;
m_Trigger = null;
m_Trigger = default;
if (m_UITaskEventList == null || m_UITaskEventNode == null) return;
m_UITaskEventList.Remove(m_UITaskEventNode);
m_UITaskEventNode = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private static void Awake(this YIUILoadComponent self)
[EntitySystem]
private static void Destroy(this YIUILoadComponent self)
{
YIUILoadComponent.m_InstRef = null;
YIUILoadComponent.m_InstRef = default;
}

public static async ETTask<bool> Initialize(this YIUILoadComponent self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public static partial class YIUIPanelComponentSystem
[EntitySystem]
private static void Awake(this YIUIPanelComponent self)
{
self.UIBindVo = self.UIBase.UIBindVo;
}

[EntitySystem]
Expand All @@ -30,7 +31,7 @@ private static void Destroy(this YIUIPanelComponent self)
self.StopCountDownDestroyPanel();
EventSystem.Instance?.YIUIInvokeSync(new YIUIInvokeDestroyPanel
{
PanelName = self.UIBase.UIBindVo.ComponentType.Name
PanelName = self.UIBindVo.ComponentType.Name
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private static void Destroy(this YIUIMgrComponent self)
YIUIBindHelper.Reset();
YIUISingletonHelper.DisposeAll();
self.ResetRoot();
YIUIMgrComponent.m_InstRef = null;
YIUIMgrComponent.m_InstRef = default;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public static partial class YIUIWindowComponentSystem
[EntitySystem]
private static void Awake(this YIUIWindowComponent self)
{
self.UIBindVo = self.UIBase.UIBindVo;
}

[EntitySystem]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ public YIUIChild UIBase
{
if (_UIBase == null)
{
_uiBase = this.GetParent<YIUIChild>();
var yiuiChild = this.GetParent<YIUIChild>();
if (yiuiChild is { IsDisposed: false })
{
_uiBase = yiuiChild;
}
}

return _UIBase;
Expand Down
20 changes: 17 additions & 3 deletions Scripts/ModelView/Client/Component/Panel/PanelInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,26 @@ public PanelInfo(YIUIBindVo vo)

public void ResetUI(YIUIChild uiBase)
{
m_UIBase = uiBase;
if (uiBase is { IsDisposed: false })
{
m_UIBase = uiBase;
}
else
{
m_UIBase = default;
}
}

public void ResetEntity(Entity entity)
{
m_OwnerUIEntity = entity;
if (entity is { IsDisposed: false })
{
m_OwnerUIEntity = entity;
}
else
{
m_OwnerUIEntity = default;
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ namespace ET.Client
[ComponentOf(typeof(YIUIChild))]
public partial class YIUIPanelComponent : Entity, IAwake, IYIUIInitialize, IDestroy
{
public YIUIBindVo UIBindVo;

private EntityRef<YIUIChild> _uiBase;
private YIUIChild _UIBase => _uiBase;

Expand All @@ -23,7 +25,11 @@ public YIUIChild UIBase
{
if (_UIBase == null)
{
_uiBase = this.GetParent<YIUIChild>();
var yiuiChild = this.GetParent<YIUIChild>();
if (yiuiChild is { IsDisposed: false })
{
_uiBase = yiuiChild;
}
}

return _UIBase;
Expand Down
6 changes: 5 additions & 1 deletion Scripts/ModelView/Client/Component/View/YIUIViewComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ public YIUIChild UIBase
{
if (_UIBase == null)
{
_uiBase = this.GetParent<YIUIChild>();
var yiuiChild = this.GetParent<YIUIChild>();
if (yiuiChild is { IsDisposed: false })
{
_uiBase = yiuiChild;
}
}

return _UIBase;
Expand Down
14 changes: 10 additions & 4 deletions Scripts/ModelView/Client/Component/Window/YIUIWindowComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public partial class YIUIWindowComponent : Entity, IAwake, IDestroy
public ETTask _LastOpenETTask;
public ETTask _LastCloseETTask;

public YIUIBindVo UIBindVo;

private EntityRef<YIUIChild> _uiBase;
private YIUIChild _UIBase => _uiBase;

Expand All @@ -28,7 +30,11 @@ public YIUIChild UIBase
{
if (_UIBase == null)
{
_uiBase = this.GetParent<YIUIChild>();
var yiuiChild = this.GetParent<YIUIChild>();
if (yiuiChild is { IsDisposed: false })
{
_uiBase = yiuiChild;
}
}

return _UIBase;
Expand Down Expand Up @@ -58,7 +64,7 @@ public Entity OwnerUIEntity
/// </summary>
public EWindowOption WindowOption = EWindowOption.None;

public bool m_FirstOpenTween;
public bool m_FirstCloseTween;
public bool m_FirstOpenTween;
public bool m_FirstCloseTween;
}
}
}

0 comments on commit 2b9ad10

Please sign in to comment.