Beispiel #1
0
    private void Awake()
    {
        _initRot = _model.transform.rotation;
        _anim    = GetComponentInChildren <Animator>();
        if (_dialogueEnterPrompt)
        {
            _dialogueEnterPrompt.gameObject.SetActive(false);
        }

        _NPCCollider = GetComponentInChildren <NPCCollider>();
    }
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);
        }