Пример #1
0
        private void Shooting()
        {
            if (_archer.enemy.transform.position.x < transform.position.x && _archer.isRightDirection
                ||
                _archer.enemy.transform.position.x > transform.position.x && !_archer.isRightDirection
                )
            {
                _archer.SwitchVision();
            }


            _archer.anim.SetTrigger("Shoot");
            _archer.rb.velocity = Vector2.zero;
        }
Пример #2
0
        public override Type Tick()
        {
            timer += Time.deltaTime;

            if (timer > _archer.TurnFreq)
            {
                _archer.SwitchVision();
                timer = 0;
            }



            if (_archer.inShootArea)
            {
                return(typeof(ShootingState));
            }
            else if (_archer.inAttackArea)
            {
                return(typeof(HittingState));
            }

            return(null);
        }