Petition-to-the-Gods-V3/Assets/Scripts/Client/ClientLastWordsSceneController.cs
2025-11-15 08:01:59 +08:00

69 lines
1.5 KiB
C#

using System;
using System.Collections;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class ClientLastWordsSceneController : MonoBehaviour
{
public static ClientLastWordsSceneController Instance;
public GameObject wordsPanel;
public GameObject surveyPanel;
public Button wordsNextButton;
public Button surveySubmitButton;
private void Awake()
{
Instance = this;
}
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
if (wordsNextButton)
{
wordsNextButton.onClick.AddListener(wordsNextButton_onClick);
}
if (surveySubmitButton)
{
surveySubmitButton.onClick.AddListener(surveySubmitButton_onClick);
}
processStep(1);
}
private void surveySubmitButton_onClick()
{
StartCoroutine(LoadNextScene());
}
private void wordsNextButton_onClick()
{
processStep(2);
}
public void processStep(int step)
{
if (wordsPanel != null)
{
wordsPanel.SetActive(step == 1);
}
if (surveyPanel)
{
surveyPanel.SetActive(step == 2);
}
}
IEnumerator LoadNextScene()
{
yield return new WaitForSeconds(0f);
SceneManager.LoadScene("ClientFinalScene");
}
// Update is called once per frame
void Update()
{
}
}