Beispiel #1
0
 public virtual void ExitDialogue()
 {
     _model.transform.rotation = _initRot;
     _anim.SetBool(Str.InConvo, false);
     if (_NPCCollider != null)
     {
         _NPCCollider.Appear();
     }
 }
Beispiel #2
0
        // Defines tasks for turtle movement.
        private Task DefineTasks()
        {
            NPCCollider npcCollider = _turtleTrans.GetComponentInChildren <NPCCollider>();
            Vector3     initScale   = npcCollider.transform.localScale;

            npcCollider.transform.localScale = Vector3.zero;
            Task wait = new WaitTask(1f);

            Task start = new ActionTask(() =>
            {
                _turtleAnim.SetBool(Str.Running, true);
                // sound?
            });

            Task prev = start;

            for (int i = 0; i < ((TurtleQuest)Context)._turtleRoute.Length; i++)
            {
                Task next = TurtleMove(((TurtleQuest)Context)._turtleRoute[i]);
                prev = prev.Then(next);
            }

            Task finish = new ActionTask
                          (
                () => {
                _turtleAnim.SetBool(Str.Running, false);
                npcCollider.transform.localScale = initScale; // causes problems
                npcCollider.Appear();                         // causes problems
                if (Context.QuestStage < 4)
                {
                    QuestManager.AdvanceQuest(Context.QuestTag);
                }
            }
                          );


            wait.Then(start);

            prev.Then(finish);

            return(wait);
        }