35 lines
785 B
C#
35 lines
785 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class IRPopup : MonoBehaviour
|
|
{
|
|
public static IRPopup Inst;
|
|
public Transform content;
|
|
public RectTransform content_ret;
|
|
public GridLayoutGroup content_grid;
|
|
|
|
float x;
|
|
float y;
|
|
|
|
private void Awake()
|
|
{
|
|
Inst = this;
|
|
x = content_ret.sizeDelta.x;
|
|
gameObject.SetActive(false);
|
|
}
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
y = content_grid.padding.top + content.childCount * content_grid.cellSize.y + (content.childCount - 1) * content_grid.spacing.y;
|
|
content_ret.sizeDelta = new Vector2(x, y);
|
|
}
|
|
}
|