using System.Collections; using System.Collections.Generic; using UnityEngine; public class ViewManager : MonoBehaviour { public static int LOGINROOM_VIEW = 0; public static int SETNAME_VIEW = 1; public static int BASESET_VIEW = 2; public static int ROOM_VIEW = 3; public GameObject[] ViewList; public static ViewManager Instance; public GameObject Tusi; public TextMesh TusiText; void Start() { Instance = this; ShowView(LOGINROOM_VIEW); } void Update() { } public void ShowView(int index) { for (int i = 0; i < ViewList.Length; i++) { if (i == index) { ViewList[i].SetActive(true); } else { ViewList[i].SetActive(false); } } } public void ShowTuSi(string msg) { Tusi.SetActive(true); TusiText.text = msg; Invoke("CloseTusi", 2f); } public void CloseTusi() { Tusi.SetActive(false); } }