using System.Collections; using System.Collections.Generic; using UnityEngine; public class GetAreaTargetManager : MonoBehaviour { public Vector3 cameraInitPos = new Vector3();//相机Target初始位置 public float initDis;//相机离Target距离的初始值 public float init_X;//相机水平旋转初始值 public float init_Y;//相机竖直旋转初始值 public static GetAreaTargetManager Instance; [SerializeField] private List children; private void Awake() { children = new List(); foreach (Transform item in transform) { children.Add(item); } Instance = this; } public Transform GetTarget(string name) { Transform result = null; foreach (var item in children) { if (item.name == name) { result = item; break; } } return result; } }