mixedcards/Assets/Story/StoryController.cs
2020-09-28 23:07:12 -04:00

27 lines
715 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class StoryController : MonoBehaviour
{
public StoryDisplay storyDisplay;
private SceneId nextSceneId;
void Start() {
// TODO: Read which scene should be loaded.
this.nextSceneId = SceneId.Prologue_First;
StartCoroutine(this.PlayScenes());
}
private IEnumerator PlayScenes() {
while (true) {
SceneId id = this.nextSceneId;
this.nextSceneId = SceneId.None;
StoryScene scene = StorySceneDatabase.Load(id);
yield return scene.Play(this.storyDisplay);
this.nextSceneId = scene.GetNextSceneId();
}
}
}