Ejemplo n.º 1
0
    void Spawn(int count)
    {
        if (transform.childCount > 0)
        {
            //TODO 删除
            UnityHelper.DestoryAllChild(transform);
        }

        for (int idx = 0; idx < count; idx++)
        {
            var clone = GameObject.Instantiate(Prefab) as GameObject;
            clone.transform.SetParent(transform);

            clone.transform.SetLocalPosZ_(0);
            clone.transform.SetLocalScale(Vector3.one);
        }
        //VLayoutGroup.SetLayoutVertical();
        VLayoutGroup.CalculateLayoutInputVertical();
    }