Ejemplo n.º 1
0
        public void Tick()
        {
            if (_stopEdge.ReachEdge())
            {
                if (_stopEdge.IsRightDirection && !_isPlayerRightSide.Invoke())
                {
                    ChaseAgain(-1.5f, -1f, 1f);
                    return;
                }
                else if (!_stopEdge.IsRightDirection && _isPlayerRightSide.Invoke())
                {
                    ChaseAgain(1.5f, 1f, 1f);
                    return;
                }

                _animation.MoveAnimation(0f);
                return;
            }

            if (_isPlayerRightSide.Invoke())
            {
                _mover.Tick(1.5f);
                _flip.FlipCharacter(1f);
            }
            else
            {
                _mover.Tick(-1.5f);
                _flip.FlipCharacter(-1f);
            }
        }
Ejemplo n.º 2
0
 public void Tick()
 {
     if (_isPlayerRightSide.Invoke()) //EnemyController içindeki IsPlayerRightSide Methodunu çalıştırır.
     {
         _mover.Tick(1.5f);
         _flip.FlipCharacter(1f);
     }
     else
     {
         _mover.Tick(-1.5f);
         _flip.FlipCharacter(-1f);
     }
 }
Ejemplo n.º 3
0
        private void FixedUpdate()
        {
            _flip.FlipCharacter(_horizontal);
            _mover.Tick(_horizontal);

            _jump.TickWithFixedUpdate();
        }
Ejemplo n.º 4
0
 private void Update()
 {
     if (Pause.Active)
     {
         return;
     }
     _mover.Tick();
     _rotator.Tick();
 }
Ejemplo n.º 5
0
    private void FixedUpdate()
    {
        if (_stunned)
        {
            return;
        }

        _mover?.Tick();
    }
Ejemplo n.º 6
0
        public void Tick()
        {
            _mover.Tick(0f); //Hareketsiz kalması sağlanıyor.

            _currentStandTime += Time.deltaTime;

            if (_currentStandTime > _maxStandTime)
            {
                IsIdle = false; //Bekleme süresi biterse IDLE çıkış yap(Stata Machine)
            }
        }
Ejemplo n.º 7
0
        private void FixedUpdate()
        {
            _flip.FlipCharacter(_horizontal);
            _mover.Tick(_horizontal);

            if (_isJump && _onGround.IsGround)
            {
                _jump.TickWithFixedUpdate();
                _isJump = false;
            }
        }
Ejemplo n.º 8
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.º 9
0
        public void Tick()
        {
            _mover.Tick(0f);

            _currentStandTime += Time.deltaTime;

            if (_currentStandTime > _maxStandTime)
            {
                IsIdle = false;
            }

            Debug.Log("Idle Tick");
        }
Ejemplo n.º 10
0
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            _mover = new Mover(this);
        }
        if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            _mover = new NavMeshMover(this);
        }

        _mover.Tick();
        _rotator.Tick();
    }
Ejemplo n.º 11
0
        public void Tick()
        {
            if (_currentPatrol == null)
            {
                return;                                                                                  //Patrols gelmezse buraya girme.
            }
            if (Vector2.Distance(_entityController.transform.position, _currentPatrol.position) <= 0.2f) //Enemy pozisyonun patrola olan uzaklığı <= 2f ise.
            {
                IsWalking = false;                                                                       //State Machine'den çıkmasını sağlıyor.
                return;
            }

            _mover.Tick(_direction); //Mover'a yürüyeceği yönü gönderiyor.
        }
Ejemplo n.º 12
0
        public void Tick()
        {
            if (_currentPatrol == null)
            {
                return;
            }

            if (Vector2.Distance(_entityController.transform.position, _currentPatrol.position) <= 0.2f)
            {
                IsWalking = false;
                return;
            }

            _mover.Tick(_direction);
            Debug.Log("Walk Tick");
        }
Ejemplo n.º 13
0
 private void FixedUpdate()
 {
     _mover.Tick(_horizontal);
 }
 void Update()
 {
     _mover.Tick();
 }
Ejemplo n.º 15
0
 private void Update()
 {
     _mover.Tick();
     _rotator.Tick();
     PlayerInput.Tick();
 }