void runChaseLogic(float searchRadius) { Optional <Dir> dir = getChaseDirection(searchRadius); if (dir.isPresent()) { moveDelegate.requestMove(this, dir.get()); } else { moveDelegate.requestIdle(); } if (moveDelegate.isLeftOrRightBlocked()) { tryToJumpOverObstacle(); } }
private void handleXInput() { float xInput = Input.GetAxis("Horizontal"); if (Mathf.Abs(xInput) < minActivation) { movementDelegate.requestIdle(); return; } movementDelegate.requestMove(this, getDirection(xInput)); }