Fix flow to/from battle, add cheat code to win

This commit is contained in:
henriquenakashima 2020-09-28 23:41:27 -04:00
parent 0b295af56b
commit 959458ad74
7 changed files with 58 additions and 16 deletions

View file

@ -6,22 +6,30 @@ public class StoryController : MonoBehaviour
{
public StoryDisplay storyDisplay;
private SceneId nextSceneId;
// TODO: Read which scene should be loaded.
private static SceneId sNextSceneId = SceneId.Prologue_First;
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;
// 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);
this.nextSceneId = scene.GetNextSceneId();
// 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;
}
}
}
}