Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        actualState.Going(carSpeed);

        if (Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.LeftArrow))
        {
            TransitionState(leftState);
        }

        if (Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow))
        {
            TransitionState(rightState);
        }
    }