コード例 #1
0
        public override void Tick()
        {
            if (HasLineOfSightToAttackTarget())
            {
                brain.SetState(new AttackState(brain));
            }

            if (Vector3.Distance(brainTransform.position, targetTransform.position) > distanceToStopAim)
            {
                brain.SetState(new IdleState(brain));
            }
        }
コード例 #2
0
        private void EndAttack()
        {
            brain.AttackModule.OnAttackEnd -= EndAttack;

            if (HasLineOfSightToAttackTarget())
            {
                brain.SetState(new AttackState(brain));
            }
            else
            {
                brain.SetState(new AimState(brain));
            }
        }
コード例 #3
0
 public override void Tick()
 {
     if (Vector3.Distance(brainTransform.position, targetTransform.position) < distanceToStartAim)
     {
         brain.SetState(new AimState(brain));
     }
 }