Esempio n. 1
0
    void runChaseLogic(float searchRadius)
    {
        Optional <Dir> dir = getChaseDirection(searchRadius);

        if (dir.isPresent())
        {
            moveDelegate.requestMove(this, dir.get());
        }
        else
        {
            moveDelegate.requestIdle();
        }
        if (moveDelegate.isLeftOrRightBlocked())
        {
            tryToJumpOverObstacle();
        }
    }
Esempio n. 2
0
    private void handleXInput()
    {
        float xInput = Input.GetAxis("Horizontal");


        if (Mathf.Abs(xInput) < minActivation)
        {
            movementDelegate.requestIdle();
            return;
        }
        movementDelegate.requestMove(this, getDirection(xInput));
    }