1
0
Fork 0
LaboratoryProtection/Assets/UnityTest/ZXL/Scripts/UI/RefreshLayout.cs

26 lines
470 B
C#
Raw Normal View History

2023-09-19 09:50:35 +08:00
using System;
using UnityEngine;
using UnityEngine.UI;
namespace UnityTest.ZXL
{
public class RefreshLayout : MonoBehaviour
{
private RectTransform rect;
private void Awake()
{
rect = GetComponent<RectTransform>();
}
private void Update()
{
Refresh();
}
private void Refresh()
{
LayoutRebuilder.ForceRebuildLayoutImmediate(rect);
}
}
}