Ejemplo n.º 1
0
        //-------------------------------------------------------------------------
        // Helper Methods
        //-------------------------------------------------------------------------
        private IEnumerator TryWalk(GraphEngine graphEngine)
        {
            UnityTask walking = WalkToPosition.WalkTo(target, Speed, graphEngine, PauseGraph, DelayAfter);

            while (walking.Running)
            {
                yield return(null);
            }

            if (FacingAfter != Facing.None)
            {
                GameManager.Player.SetFacing(FacingAfter);
            }

            yield return(new WaitForSeconds(DelayAfter));

            if (PauseGraph)
            {
                graphEngine.UnlockNode();
            }
        }
Ejemplo n.º 2
0
        //-------------------------------------------------------------------------
        // Helper Methods
        //-------------------------------------------------------------------------

        /// <summary>
        /// Play a timeline!
        /// </summary>
        /// <param name="graphEngine">The graphing engine that called this node.</param>
        /// <returns></returns>
        private IEnumerator PlayTimeline(GraphEngine graphEngine)
        {
            bool containsPlayer = TimelineContainsPlayer();

            if (containsPlayer && StartPosition != null)
            {
                UnityTask walk = WalkToPosition.WalkTo(StartPosition, InputSpeed, graphEngine, true, WaitBefore);

                while (walk.Running)
                {
                    yield return(null);
                }
            }

            UnityTask play = new UnityTask(Play(graphEngine));

            while (play.Running)
            {
                yield return(null);
            }

            graphEngine.UnlockNode();
        }