Initial Code
This commit is contained in:
19
UI/Components/UILayoutRebuilder.cs
Normal file
19
UI/Components/UILayoutRebuilder.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace VMM.UI.Components
|
||||
{
|
||||
internal class UILayoutRebuilder : MonoBehaviour
|
||||
{
|
||||
RectTransform parentRect;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if(parentRect == null)
|
||||
{
|
||||
parentRect = transform.parent.GetComponent<RectTransform>();
|
||||
}
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(parentRect);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user