private void Update() { if (_touchingLeftWall || _touchingRightWall) { _timeGrabbingWall += Time.deltaTime; } if (!_touchingRightWall && _rightTrigger) { OnTouchingWall?.Invoke(true, _characterController.FacingRight); return; } if (!_touchingLeftWall && _leftTrigger) { OnTouchingWall?.Invoke(true, !_characterController.FacingRight); return; } if (!_rightTrigger && !_leftTrigger && (_touchingLeftWall || _touchingRightWall)) { OnTouchingWall?.Invoke(false, false); } }
private void OnLand() { _timeGrabbingWall = 0; _previousCollider = float.MaxValue; OnTouchingWall?.Invoke(false, false); }