private void Awake() { _movementChecker = transform.GetComponentInChildren <MovementChecker>(); if (_movementChecker == null) { Debug.LogError("Movement checker is missing"); } _playerMovement = transform.GetComponent <PlayerMovement>(); if (_playerMovement == null) { Debug.LogError("PlayerMovement is not found"); } _animatorHandler = GetComponentInChildren <PlayerAnimationHandling>(); if (_animatorHandler == null) { Debug.LogError("_animatorHandler is not found"); } }
void Awake() { if (player == null) { player = this; } _collider = GetComponent <Collider>(); _playerControls = new PlayerControls(); _playerControls.Enable(); _playerControls.Main.Movement.performed += OnAxesChanged; _playerControls.Main.Movement.canceled += OnAxesChanged; _playerControls.Main.Dash.started += OnDash; DashReponse = GetComponent <IDashResponse>(); if (DashReponse == null) { Debug.LogError("Dash Response missing in PlayerMovement"); } animationHandler = GetComponent <PlayerAnimationHandling>(); EventsManager.StartListening("OnPlayerHit", WaitTimer); }