using System; using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; using UnityEngine.UI; public enum CarType { 首页, 车类型, 天气, 危险驾驶 } public class GameManager : MonoBehaviour { public static GameManager instance; // public List home; //首页 // // // public List carType; //车类型 // public List weather; //天气 // public List dangerDriving; //危险驾驶 public GameObject[] uiGames; private int currentStep = 0; // 当前步骤索引 public Dictionary carSelectTypeInfo = new Dictionary(); private void Awake() { instance = this; // home = new List(); // // carType = new List(); // weather = new List(); // dangerDriving = new List(); DontDestroyOnLoad(this); } private void Start() { // // 等待所有 BtClick 对象的 Start 方法完成 // yield return StartCoroutine(WaitForBtClickStarts()); // // // 所有 BtClick 的 Start 方法已完成,继续执行其他代码 // Debug.Log("All BtClick Start methods completed."); // // 执行其他方法 // for (int i = 0; i < uiGames.Length; i++) // { // uiGames[i].SetActive(false); // } // // uiGames[0].SetActive(true); // GetComponent().buttons = home; // UIClick(CarType.首页, "模拟驾驶体验"); // NextStep("3"); GetComponent().buttons = uiGames[currentStep].GetComponentsInChildren