Exemple #1
0
 public override void Handle(GraphEngine graphEngine)
 {
     if (StartClosed)
     {
         DialogManager.CloseDialogBox();
     }
 }
        /// <summary>
        /// Play a timeline (after dealing with the player character if they're in
        /// the scene).
        /// </summary>
        /// <param name="graphEngine">THe graphing engine that's handling this node.</param>
        private IEnumerator Play(GraphEngine graphEngine)
        {
            // Close the dialog box if desired.
            if (CloseDialogBefore)
            {
                DialogManager.CloseDialogBox();
            }

            yield return(new WaitForSeconds(WaitBefore));

            UpdateOutro();

            // Play timeline and wait until finished.
            Director.RebuildGraph();
            Director.Play();
            bool playing = true;

            Action <PlayableDirector> onStop = (PlayableDirector director) => { playing = false; };

            Director.stopped += onStop;

            while (playing && Director.playableGraph.IsPlaying())
            {
                yield return(null);
            }

            Director.stopped -= onStop;

            // Wait additional time if desired.
            yield return(new WaitForSeconds(WaitAfter));


            // Reopen the default dialog box if desired.
            if (CloseDialogBefore && OpenDialogAfter)
            {
                DialogManager.OpenDialogBox();
            }
        }