11 lines
385 B
C#
11 lines
385 B
C#
|
|
using UnityEngine;
|
||
|
|
public class MatchHeight : MonoBehaviour
|
||
|
|
{
|
||
|
|
public RectTransform childRectTransform;
|
||
|
|
public RectTransform parentRectTransform;
|
||
|
|
void Update()
|
||
|
|
{
|
||
|
|
if (parentRectTransform.sizeDelta.y != childRectTransform.sizeDelta.y)
|
||
|
|
parentRectTransform.sizeDelta = new Vector2(parentRectTransform.sizeDelta.x, childRectTransform.sizeDelta.y);
|
||
|
|
}
|
||
|
|
}
|