Exemplo n.º 1
0
            protected override void onEnter(TBTWorkingData wData)
            {
                TurnToStatus = TBTRunningStatus.EXECUTING;
                AIEntityWorkingData thisData = wData.As <AIEntityWorkingData>();

                thisData.entityAnimation.Play("Attack");
            }
Exemplo n.º 2
0
            protected override int onExecute(TBTWorkingData wData)
            {
                AIEntityWorkingData thisData     = wData.As <AIEntityWorkingData>();
                Vector3             moveDistance = Vector3.Normalize(WarriorAI.Instance.transform.position - thisData.entityTF.position) * 0.1f;

                thisData.entityTF.DOMove(thisData.entityTF.position + moveDistance, Time.deltaTime)
                .OnComplete(() => UpdateStatus());
                return(MoveToStatus);
            }
Exemplo n.º 3
0
        private void Awake()
        {
            _behaviorWorkingData = new AIEntityWorkingData();
            _behaviorWorkingData.entityAnimator = GetComponent <Animator>();
            _behaviorWorkingData.entityTF       = transform;

            _behaviorTree = new TBTActionPrioritizedSelector();
            _behaviorTree
            .AddChild(new TBTActionSequence()
                      .SetPrecondition(new TBTPreconditionNOT(new HasReachedTarget()))
                      .AddChild(new TurnToAction())
                      .AddChild(new MoveToAction()))
            .AddChild(new TBTActionParallel()
                      .AddChild(new TurnToAction())
                      .AddChild(new AttackAction()));
        }
Exemplo n.º 4
0
        private void Awake()
        {
            _behaviorWorkingData = new AIEntityWorkingData();
            _behaviorWorkingData.entityAnimation = GetComponent <Animation>();
            _behaviorWorkingData.entityTF        = transform;

            _behaviorTree = new TBTActionPrioritizedSelector();
            _behaviorTree
            .AddChild(new TBTActionSequence()
                      .SetPrecondition(new TBTPreconditionNOT(new HasReachEnemy()))
                      .AddChild(new LookEnemyAction())
                      .AddChild(new IdleAction()))
            .AddChild(new TBTActionParallel()
                      .AddChild(new LookEnemyAction())
                      .AddChild(new AttackAction()));
        }
Exemplo n.º 5
0
            protected override void onEnter(TBTWorkingData wData)
            {
                AIEntityWorkingData thisData = wData.As <AIEntityWorkingData>();

                thisData.entityAnimator.CrossFade("attack", 0.2f);
            }
Exemplo n.º 6
0
            protected override void onEnter(TBTWorkingData wData)
            {
                AIEntityWorkingData thisData = wData.As <AIEntityWorkingData>();

                thisData.entityAnimation.Play("idle");
            }