Exemplo n.º 1
0
    private void Start()
    {
        PlayerInput playerInput = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerInput>();

        playerInput.AddKeyCallback(KeyCode.W, MoveForward);
        playerInput.AddKeyCallback(KeyCode.S, MoveBackward);
        playerInput.AddKeyCallback(KeyCode.D, MoveRight);
        playerInput.AddKeyCallback(KeyCode.A, MoveLeft);
    }