修复了一些代码上的漏洞与预制体上的错误

This commit is contained in:
2025-08-31 19:42:33 +08:00
parent e432177af8
commit 2c784ff343
6 changed files with 638 additions and 11 deletions

View File

@@ -313,8 +313,12 @@ namespace Convention.WindowsUI.Variant
}
static IEnumerator Adjuster2(RectTransform rectTransform, ItemEntry parentEntry)
{
if (rectTransform == null)
yield break;
LayoutRebuilder.ForceRebuildLayoutImmediate(rectTransform);
yield return null;
if (rectTransform == null)
yield break;
RectTransformExtension.AdjustSizeToContainsChilds(rectTransform);
yield return null;
parentEntry.ForceRebuildLayoutImmediate();
@@ -364,6 +368,8 @@ namespace Convention.WindowsUI.Variant
ForceRebuildLayoutImmediate();
}
public bool IsRemovingChilds { get; private set; } = false;
public void Release()
{
if ((parentWindow == null && parentEntry == null) || childs == null || rootWindow == null)
@@ -376,21 +382,18 @@ namespace Convention.WindowsUI.Variant
ref_value.gameObject.SetActive(false);
Destroy(ref_value.gameObject);
}
IsRemovingChilds = true;
foreach (var item in childs)
{
item.Release();
}
IsRemovingChilds = false;
if (parentWindow != null)
parentWindow.m_Entrys.Remove(this);
else
else if (GetParent().IsRemovingChilds == false)
parentEntry.childs.Remove(this);
ref_value = null;
}
~ItemEntry()
{
Release();
}
}
public interface IItemEntry
{