26 lines
758 B
C#
26 lines
758 B
C#
using UnityEngine;
|
|
using BrewMonster.Scripts.Task.UI;
|
|
using UnityEngine.UI;
|
|
namespace BrewMonster
|
|
{
|
|
public class ItemInfo : MonoBehaviour, IRefreshLayout
|
|
{
|
|
public void RefreshLayout()
|
|
{
|
|
var rectTransform = GetComponent<RectTransform>();
|
|
if (rectTransform == null)
|
|
{
|
|
return;
|
|
}
|
|
rectTransform.ForceUpdateRectTransforms();
|
|
LayoutRebuilder.ForceRebuildLayoutImmediate(rectTransform);
|
|
Debug.Log("ItemInfo RefreshLayout");
|
|
if (transform.parent &&
|
|
transform.parent.TryGetComponent<IRefreshLayout>(out var refreshLayout))
|
|
{
|
|
refreshLayout.RefreshLayout();
|
|
}
|
|
}
|
|
}
|
|
}
|