using UnityEngine; using UnityEngine.UI; public class ServerWorkSceneController : MonoBehaviour { public static ServerWorkSceneController Instance; public GameObject introPanel; public GameObject messagePanel; public GameObject messageReplyPanel; public GameObject messageReplyWordsPanel; public GameObject messageReplyWait1Panel; public GameObject messageReplyWait1WorkingPanel; public GameObject messageReplyWait2Panel; public GameObject messageReplyWait2WorkingPanel; public GameObject messageReplyExitPanel; public GameObject messageReplyExitSurveyPanel; public GameObject exitWorkPanel; public GameObject messageReplyContinuePanel; public GameObject gamePanel; void Awake() { Instance = this; } private void OnEnable() { } private void OnDisable() { Instance = null; } void Start() { SetupScene(); } void SetupScene() { processStep(1); } public void processStep(int step) { if (introPanel) { introPanel.SetActive(step == 1 ? true : false); } if (messagePanel) { messagePanel.SetActive(step == 2 ? true : false); } if (messageReplyPanel) { messageReplyPanel.SetActive(step == 3 ? true : false); } if (messageReplyWordsPanel) { messageReplyWordsPanel.SetActive(step == 4 ? true : false); } if (messageReplyWait1Panel) { messageReplyWait1Panel.SetActive(step == 5 ? true : false); if (ServerWorkMessageReplyWait1Panel.Instance) { if (step == 5) { ServerWorkMessageReplyWait1Panel.Instance.play(); } else { ServerWorkMessageReplyWait1Panel.Instance.stop(); } } } if (messageReplyWait1WorkingPanel) { messageReplyWait1WorkingPanel.SetActive(step == 6 ? true : false); if (ServerWorkMessageReplyWait1WorkingPanel.Instance) { if (step == 6) { ServerWorkMessageReplyWait1WorkingPanel.Instance.play(); } else { ServerWorkMessageReplyWait1WorkingPanel.Instance.stop(); } } } if (messageReplyWait2Panel) { messageReplyWait2Panel.SetActive(step == 7 ? true : false); if (ServerWorkMessageReplyWait2Panel.Instance) { if (step == 7) { ServerWorkMessageReplyWait2Panel.Instance.play(); } else { ServerWorkMessageReplyWait2Panel.Instance.stop(); } } } if (messageReplyWait2WorkingPanel) { messageReplyWait2WorkingPanel.SetActive(step == 8 ? true : false); if (ServerWorkMessageReplyWait2WorkingPanel.Instance) { if (step == 8) { ServerWorkMessageReplyWait2WorkingPanel.Instance.play(); } else { ServerWorkMessageReplyWait2WorkingPanel.Instance.stop(); } } } if (messageReplyExitPanel) { messageReplyExitPanel.SetActive(step == 9 ? true : false); if (ServerWorkMessageReplyExitPanel.Instance) { if (step == 9) { ServerWorkMessageReplyExitPanel.Instance.play(); } else { ServerWorkMessageReplyExitPanel.Instance.stop(); } } } if (messageReplyExitSurveyPanel) { messageReplyExitSurveyPanel.SetActive(step == 10 ? true : false); } if (exitWorkPanel) { exitWorkPanel.SetActive(step == 11 ? true : false); if (ServerWorkExitWorkPanel.Instance) { if (step == 11) { ServerWorkExitWorkPanel.Instance.play(); } else { ServerWorkExitWorkPanel.Instance.stop(); } } } if (messageReplyContinuePanel) { messageReplyContinuePanel.SetActive(step == 12 ? true : false); if (ServerWorkMessageReplyContinuePanel.Instance) { if (step == 12) { ServerWorkMessageReplyContinuePanel.Instance.play(); } else { ServerWorkMessageReplyContinuePanel.Instance.stop(); } } } if (gamePanel) { gamePanel.SetActive(step == 13 ? true : false); } } }