Updated all components using "LayoutGroup" to override their OnDisable feature to incorporate this fix:

https://gist.github.com/randomize/73ca6d3b6aa7210073692eb5cabd537e

Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/178
pull/413/head
Simon Jackson 2022-12-24 13:28:19 +00:00
parent e78a2806ed
commit 3ed20ecaed
4 changed files with 29 additions and 1 deletions

View File

@ -29,6 +29,13 @@ namespace UnityEngine.UI.Extensions
public float centerpoint = 0.5f;
protected override void OnEnable() { base.OnEnable(); CalculateRadial(); }
protected override void OnDisable()
{
m_Tracker.Clear();
LayoutRebuilder.MarkLayoutForRebuild(rectTransform);
}
public override void SetLayoutHorizontal() {
}
public override void SetLayoutVertical() {

View File

@ -422,5 +422,13 @@ namespace UnityEngine.UI.Extensions
}
return max;
}
}
protected override void OnDisable()
{
m_Tracker.Clear();
LayoutRebuilder.MarkLayoutForRebuild(rectTransform);
}
}
}

View File

@ -55,6 +55,13 @@ namespace UnityEngine.UI.Extensions
CalculateRadial();
}
#endif
protected override void OnDisable()
{
m_Tracker.Clear(); // key change - do not restore - false
LayoutRebuilder.MarkLayoutForRebuild(rectTransform);
}
void CalculateRadial()
{
m_Tracker.Clear();

View File

@ -284,5 +284,11 @@ namespace UnityEngine.UI.Extensions
// Set preferredRowHeights to null to free memory
preferredRowHeights = null;
}
protected override void OnDisable()
{
m_Tracker.Clear(); // key change - do not restore - false
LayoutRebuilder.MarkLayoutForRebuild(rectTransform);
}
}
}