using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement; public class GameSceneLoadBtns : MonoBehaviour { public static void Create() { GameObject.Instantiate(Resources.Load("Prefabs/GameSceneLoadBtns"), GameObject.Find("GameMgr/Canvas").transform); } // Start is called before the first frame update void Start() { string curSceneName = SceneManager.GetActiveScene().name; string[] sceneNames = {"Demo_01", "demoScene_free", "Demo"}; for (int i = 0; i < this.transform.childCount; i++) { Transform t = this.transform.GetChild(i); t.GetComponentInChildren().text = "场景" + (i + 1); string sceneName = sceneNames[i]; if (sceneName == curSceneName) { t.GetComponent().color = Color.green; } t.GetComponent