mixedcards/Assets/Story/StoryController.cs
2020-09-28 23:41:27 -04:00

35 lines
1.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class StoryController : MonoBehaviour
{
public StoryDisplay storyDisplay;
// TODO: Read which scene should be loaded.
private static SceneId sNextSceneId = SceneId.Prologue_First;
void Start() {
StartCoroutine(this.PlayScenes());
}
private IEnumerator PlayScenes() {
while (true) {
// Debug.Log("SceneId id = " + sNextSceneId);
SceneId id = sNextSceneId;
// Debug.Log("sNextSceneId = " + SceneId.None);
sNextSceneId = SceneId.None;
// Debug.Log("StoryScene scene = Load()");
StoryScene scene = StorySceneDatabase.Load(id);
// Debug.Log("yield return scene.Play()");
yield return scene.Play(this.storyDisplay);
// Debug.Log("sNextSceneId = scene.GetNextSceneId() [" + scene.GetNextSceneId() + "]");
sNextSceneId = scene.GetNextSceneId();
// Debug.Log("if scene.IsBattleNext() [" + scene.IsBattleNext() + "]");
if (scene.IsBattleNext()) {
// Debug.Log("yield break");
yield break;
}
}
}
}