寻找父物体有几个子物体
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FollowPathMove : MonoBehaviour
{
public Transform[] wayPointArray;
public Transform PathA;//路径点的父物体
void Start()
{
//print(PathA.childCount);//获取子物体的数量
//开辟空间
wayPointArray = new Transform[PathA.childCount];
for(int i=0;i<wayPointArray.Length;i++)
{
wayPointArray[i]=PathA.GetChild(i);
}
}
// Update is called once per frame
void Update()
{
}
}