ict.shenzhi/Assets/ZHYscrip/scrip/Vertical.cs

19 lines
428 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Vertical : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
this.GetComponent<RectTransform>().sizeDelta = new Vector3(230f,32.5f+int.Parse((this.transform.childCount/2-1).ToString()) * 32.5f, 0);
}
}