87 lines
2.0 KiB
C#
87 lines
2.0 KiB
C#
using System.Collections;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
using UnityEngine.UI;
|
|
|
|
public class ClientGameTalkingSceneController : MonoBehaviour
|
|
{
|
|
public static ClientGameTalkingSceneController Instance;
|
|
public static int playCount = 0;
|
|
|
|
public GameObject introPanel;
|
|
public GameObject playPanel;
|
|
public GameObject stopPanel;
|
|
public GameObject finishPanel;
|
|
|
|
public TMP_Text playCountdownText;
|
|
public TMP_Text playChatText;
|
|
public TMP_InputField playMessageInputField;
|
|
public Button playMessageSendButton;
|
|
|
|
public Button finishGoToNextButton;
|
|
public Button finishBackToMenuButton;
|
|
|
|
private void Awake()
|
|
{
|
|
Instance = this;
|
|
}
|
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
void Start()
|
|
{
|
|
if (finishGoToNextButton)
|
|
{
|
|
finishGoToNextButton.onClick.AddListener(finishGoToNextButton_onClicked);
|
|
}
|
|
if (finishBackToMenuButton)
|
|
{
|
|
finishBackToMenuButton.onClick.AddListener(finishBackToMenuButton_onClicked);
|
|
}
|
|
|
|
processStep(4);
|
|
}
|
|
|
|
private void finishGoToNextButton_onClicked()
|
|
{
|
|
StartCoroutine(LoadNextScene("ClientGameBackToRealScene"));
|
|
}
|
|
|
|
private void finishBackToMenuButton_onClicked()
|
|
{
|
|
StartCoroutine(LoadNextScene("ClientGameScene"));
|
|
}
|
|
|
|
public void processStep(int step)
|
|
{
|
|
if (introPanel)
|
|
{
|
|
introPanel.SetActive( step == 1 );
|
|
playCount++;
|
|
}
|
|
if (playPanel)
|
|
{
|
|
playPanel.SetActive ( step == 2 );
|
|
}
|
|
if (stopPanel)
|
|
{
|
|
stopPanel.SetActive ( step == 3 );
|
|
}
|
|
if (finishPanel)
|
|
{
|
|
finishPanel.SetActive ( step == 4 );
|
|
}
|
|
}
|
|
|
|
IEnumerator LoadNextScene(string sceneName)
|
|
{
|
|
yield return new WaitForSeconds(0f);
|
|
SceneManager.LoadScene(sceneName);
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|