28 lines
645 B
C#
28 lines
645 B
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEditor.PackageManager;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
|
||
|
public class UpdateChiclPosition : MonoBehaviour
|
||
|
{
|
||
|
short previousChildCount;
|
||
|
// Start is called before the first frame update
|
||
|
void Start()
|
||
|
{
|
||
|
previousChildCount = (short)transform.childCount;
|
||
|
}
|
||
|
|
||
|
// Update is called once per frame
|
||
|
void Update()
|
||
|
{
|
||
|
if (transform.childCount>previousChildCount)
|
||
|
{
|
||
|
previousChildCount = (short)transform.childCount;
|
||
|
transform.GetComponent<VerticalLayoutGroup>().SetLayoutVertical();
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|