Ejemplo n.º 1
0
        private void Awake()
        {
            AttackerTimer.SetTimer(_playerParameters.TimeBetweenAttacks);
            _waitForSecondsDash = new WaitForSeconds(_playerParameters.TimeBetweenDashes);

            Grounder      = new Grounder(this);
            LifeSystem    = new LifeSystem(this);
            _mover        = new NewMover(this);
            _jumper       = new Jumper(this);
            _playerLocker = new PlayerLocker(this);
            _glider       = new Glider(this);
            _attacker     = new BasicAttacker(this);
            _wallJumper   = new WallJumper(this);

            Rigidbody = this.GetComponent <Rigidbody2D>();

            // _attackerList = new List<IAttacker>();
            // _attackerList.Add(new BasicAttacker(this));
            // _attackerList.Add(new StrongAttacker(this));
        }
Ejemplo n.º 2
0
        private void Update()
        {
            AttackerTimer.SubtractTimer();

            Grounder.Tick();

            if (!(_mover is ForceMover))
            {
                if (!_attacking && CanMove)
                {
                    _mover.Tick();

                    if (!(_mover is Dasher))
                    {
                        _jumper.Tick();
                        _wallJumper.Tick();
                    }

                    if (Dasher.CheckDashInput())
                    {
                        StartDash();
                    }
                }
            }
            else
            {
                _mover.Tick();
            }

            _attacker.Tick();
            //_attackerList.ForEach(attacker => attacker.Tick());

            CheckJumping();

            var isGrounded = Grounder.IsGrounded;

            AnimatorController.UpdateParameters(isGrounded);
            JustTouchedGround(isGrounded);
        }
Ejemplo n.º 3
0
 public void EndAttack()
 {
     _attacking = false;
     //_playerLocker.UnlockPlayer();
     AttackerTimer.ResetTimer();
 }