private void HandleSceneChange(Domain.Scene scene, EventType type)
 {
     if (this.scene != null)
     {
         ExitScene();
     }
     this.scene = scene;
     EmitCharacters(type);
     if (type == EventType.Start)
     {
         Scene.sprite = scene.Image;
         Scene.color  = Color.white;
         textIndex    = 0;
         ShowDialog();
     }
 }
Example #2
0
        private void Update()
        {
            if (waiting || story == null)
            {
                return;
            }
            else if (story.Scenes.Length <= nextSceneIndex)
            {
                if (scene != null && story.Scenes.Length == nextSceneIndex)
                {
                    EmitScene(EventType.End);
                    EmitStoryCharacters(EventType.End);
                    nextSceneIndex++;
                    EmitStory(EventType.End);
                }
                return;
            }

            if (nextSceneIndex == -1)
            {
                EmitStory(EventType.Start);
                EmitStoryCharacters(EventType.Start);
                nextSceneIndex = 0;
                waiting        = false;
            }
            else
            {
                if (scene != null)
                {
                    EmitScene(EventType.End);
                }
                scene = story.Scenes[nextSceneIndex];
                nextSceneIndex++;
                EmitScene(EventType.Start);
                waiting = true;
            }
        }