using System.Collections; using System.Collections.Generic; using Unity.VisualScripting; using UnityEngine; using UnityEngine.UI; using System.Threading.Tasks; public class Panel2 : MonoBehaviour { public static Panel2 instance; private Toggle toggle;//角色名是否出现 private Button follow;//跟随查按钮 private Button end;//结束按钮 private Dropdown dropdown; private int optionCount; // 用于存储传入的确定Dropdown选项数量的参数 private List nameImage; // 存储所有角色标签的子物体 private GameObject peopleposition; public Camera godView; // 上帝视角的位置 public List playerCameras = new List(); // 存储每个角色的摄像机 private bool isGodView = true; // 是否为上帝视角 public int currentCameraIndex = -1; public List target;//目标 public GameObject panel1_22; public GameObject panel1_33; // Start is called before the first frame update void Start() { instance = this; godView=GameObject.Find("TopCamera").GetComponent(); toggle =transform.Find("right/under/Toggle").GetComponent(); toggle.onValueChanged.AddListener(OnToggleValueChanged); toggle.isOn = true; dropdown =transform.Find("left/Dropdown").GetComponent(); follow=transform.Find("left/Follow").GetComponent