82 lines
1.8 KiB
C#
82 lines
1.8 KiB
C#
using System;
|
|
using System.Collections;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
using UnityEngine.UI;
|
|
|
|
public class ClientWorkMessageResultViewSceneController : MonoBehaviour
|
|
{
|
|
public static ClientWorkMessageResultViewSceneController Instance;
|
|
|
|
public GameObject step1Panel;
|
|
public Button step1NextButton;
|
|
public GameObject step2Panel;
|
|
public Button step2NextButton;
|
|
public TMP_Text step2WordsText;
|
|
|
|
|
|
private void Awake()
|
|
{
|
|
Instance = this;
|
|
}
|
|
|
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
void Start()
|
|
{
|
|
|
|
if (step1NextButton)
|
|
{
|
|
step1NextButton.onClick.AddListener(step1NextButton_onClicked);
|
|
}
|
|
|
|
if (step2NextButton)
|
|
{
|
|
step2NextButton.onClick.AddListener(step2NextButton_onClicked);
|
|
}
|
|
|
|
if (step2WordsText)
|
|
{
|
|
step2WordsText.text = ClientWorkMessageHandleSceneController.messageResultText;
|
|
}
|
|
processStep(1);
|
|
}
|
|
|
|
private void step2NextButton_onClicked()
|
|
{
|
|
ClientWorkMessageHandleSceneController.messageResultCount = 1;
|
|
StartCoroutine(LoadNextScene());
|
|
}
|
|
|
|
private void step1NextButton_onClicked()
|
|
{
|
|
processStep(2);
|
|
}
|
|
|
|
public void processStep(int step)
|
|
{
|
|
if (step1Panel)
|
|
{
|
|
step1Panel.SetActive(step == 1 ? true : false);
|
|
}
|
|
|
|
if (step2Panel)
|
|
{
|
|
step2Panel.SetActive(step == 2 ? true : false);
|
|
}
|
|
}
|
|
|
|
public IEnumerator LoadNextScene()
|
|
{
|
|
yield return new WaitForSeconds(0f);
|
|
SceneManager.LoadScene("ClientWorkScene");
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|