Implement scene transition
This commit is contained in:
parent
edc3abff84
commit
0b295af56b
6 changed files with 30 additions and 16 deletions
|
|
@ -6,19 +6,22 @@ public class StoryController : MonoBehaviour
|
|||
{
|
||||
public StoryDisplay storyDisplay;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
// TODO: Read which scene should be loaded.
|
||||
//StoryScene scene = StorySceneDatabase.Load(SceneId.Chapter1_Cave);
|
||||
StoryScene scene = StorySceneDatabase.Load(SceneId.Prologue_First);
|
||||
private SceneId nextSceneId;
|
||||
|
||||
StartCoroutine(scene.Play(this.storyDisplay));
|
||||
void Start() {
|
||||
// TODO: Read which scene should be loaded.
|
||||
this.nextSceneId = SceneId.Prologue_First;
|
||||
|
||||
StartCoroutine(this.PlayScenes());
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue