forked from zxl/LaboratoryProtection
26 lines
470 B
C#
26 lines
470 B
C#
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);
|
|
}
|
|
}
|
|
} |