Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetAxis("Horizontal") != 0)
        {
            shipMovement.MoveRight(Input.GetAxis("Horizontal"));
        }
        if (Input.GetAxis("Vertical") != 0)
        {
            shipMovement.MoveForward(Input.GetAxis("Vertical"));
        }
        if (Input.GetAxis("UpDown") != 0)
        {
            shipMovement.MoveUp(Input.GetAxis("UpDown"));
        }
        if (Input.GetAxis("Roll") != 0)
        {
            shipMovement.Roll(Input.GetAxis("Roll"));
        }
        Vector2 turn;

        turn = new Vector2(Input.GetAxis("Mouse Y"), Input.GetAxis("Mouse X"));
        shipMovement.Turn(turn);
    }