private void SetCameraTargets()
{
// Create a collection of transforms the same size as the number of tanks.
Transform[] targets = new Transform[m_Tanks.Length];
// For each of these transforms...
for (int i = 0; i < targets.Length; i++)
{
// ... set it to the appropriate tank transform.
targets[i] = m_Tanks[i].m_Instance.transform;
}
// These are the targets the camera should follow.
m_CameraControl.m_Targets = targets;
}
接收的目的让相机显示所有的物体
相机的CameraContral带一个求重心和缩放的功能
为什么要new一个target呢