47 lines
915 B
C#
47 lines
915 B
C#
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
using UnityEngine.UI;
|
|
using System.Collections;
|
|
using TMPro;
|
|
using System;
|
|
|
|
public class ServerHomeSceneController : MonoBehaviour
|
|
{
|
|
public static ServerHomeSceneController Instance;
|
|
|
|
[Header("UI 元件")]
|
|
public Button StartBtn;
|
|
|
|
void Awake()
|
|
{
|
|
Instance = this;
|
|
}
|
|
|
|
void Start()
|
|
{
|
|
SetupScene();
|
|
}
|
|
|
|
void SetupScene()
|
|
{
|
|
if (GlobalMenuManager.Instance != null)
|
|
{
|
|
GlobalMenuManager.Instance.menuButton.SetActive(true);
|
|
}
|
|
|
|
StartBtn.onClick.RemoveAllListeners();
|
|
StartBtn.onClick.AddListener(StartBtn_Click);
|
|
}
|
|
|
|
private void StartBtn_Click()
|
|
{
|
|
StartCoroutine(LoadNextScene());
|
|
}
|
|
|
|
|
|
IEnumerator LoadNextScene()
|
|
{
|
|
yield return new WaitForSeconds(0f);
|
|
SceneManager.LoadScene("ServerHomeWaittingScene");
|
|
}
|
|
} |