using System.Collections; using System.Collections.Generic; using UnityEngine; public class UITempManager : MonoBehaviour { public GameObject LoginPanel; public GameObject UserManager; public GameObject TeacherMainPanel; public GameObject Subject1EditorPanel; public GameObject Sub2EditorPanel; public GameObject StudentWaitPanel; public GameObject StudentSub1Editor; public GameObject StudentSub1Runing; public GameObject StudentSub2Editor; public GameObject StudentSub3Runing; // Start is called before the first frame update void Start() { EventCenter.Instance.AddEventListener("SignIn", UserSignin); EventCenter.Instance.AddEventListener("EditorFile", EditorOldFile); EventCenter.Instance.AddEventListener("CreatFile", CreatNewFile); LoginPanel.gameObject.SetActive(true); } // Update is called once per frame void UserSignin(UserType userType) { switch (userType) { case UserType.student: StudentWaitPanel.gameObject.SetActive(true); break; case UserType.Teacher: TeacherMainPanel.gameObject.SetActive(true); break; case UserType.manager: UserManager.gameObject.SetActive(true); break; default: break; } } void EditorOldFile(RecordBase recordBase) { if (recordBase.subName == NetSubNameEnum.编队行军) { Subject1EditorPanel.gameObject.SetActive(true); // Subject1EditorPanel.GetComponent().InitContentIncon(recordBase); } else { Sub2EditorPanel.SetActive(true); //Sub2EditorPanel.GetComponent().InitContentIncon(recordBase); } } void CreatNewFile(string subName) { if (subName == "Sub1") { Subject1EditorPanel.gameObject.SetActive(true); //Subject1EditorPanel.GetComponent().InitContentIncon(); } else if(subName=="Sub2") { Sub2EditorPanel.SetActive(true); //Sub2EditorPanel.GetComponent().InitContentIncon(); } } }