65 lines
1.5 KiB
C#
65 lines
1.5 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.AddressableAssets;
|
|
|
|
namespace AibisDream
|
|
{
|
|
public class GameLoopManager : Singleton<GameLoopManager>
|
|
{
|
|
[Header("第一个对话")]
|
|
[SerializeField] private TalkSceneSO firstTalkSO;
|
|
|
|
private TalkSceneSO currentTalkSceneSO;
|
|
|
|
[SerializeField]
|
|
private string clinicScene;
|
|
|
|
[SerializeField]
|
|
private RunMode runMode;
|
|
|
|
[SerializeField]
|
|
private string testScene;
|
|
|
|
private void Start()
|
|
{
|
|
if (runMode == RunMode.Pro)
|
|
{
|
|
// 生产
|
|
GameObject UI = GameObject.Find("UI");
|
|
UI.SetActive(true);
|
|
}
|
|
else if (runMode == RunMode.Test)
|
|
{
|
|
if (testScene == null)
|
|
{
|
|
Debug.Log("请输入测试场景名称");
|
|
}
|
|
|
|
// 单场景测试
|
|
SceneLoader.Instance.LoadScene(testScene);
|
|
}
|
|
}
|
|
|
|
public void StartNewGame()
|
|
{
|
|
currentTalkSceneSO = firstTalkSO;
|
|
|
|
StartCoroutine(LoadClinicScene());
|
|
}
|
|
|
|
private IEnumerator LoadClinicScene()
|
|
{
|
|
yield return StartCoroutine(SceneLoader.Instance.LoadSceneAsync(clinicScene));
|
|
StartMenuViewer.Instance.HideStartMenu();
|
|
DialogController.Instance.StartDialog(currentTalkSceneSO.yarnProject);
|
|
}
|
|
}
|
|
|
|
public enum RunMode
|
|
{
|
|
Test, Pro
|
|
}
|
|
}
|
|
|