Advertisement
Guest User

UserInput.cs

a guest
Apr 18th, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class UserInput : MonoBehaviour {
  5.     SpacecraftControl spacecraftControl;
  6.  
  7.     // Use this for initialization
  8.     void Start () {
  9.         spacecraftControl = GetComponent<SpacecraftControl> ()  ;
  10.     }
  11.    
  12.     // Update is called once per frame
  13.     void FixedUpdate () {
  14.         //float roll = Input.GetAxis("Yaw");
  15.         float roll = Input.GetAxis("Horizontal");
  16.         float pitch = Input.GetAxis("Vertical");
  17.         //float yaw = Input.GetAxis("Horizontal");
  18.         bool airBrakes = Input.GetButton("Fire1");
  19.         float Throttle = Input.GetAxis("Throttle");
  20.  
  21.         spacecraftControl.Move(roll, pitch, 0, Throttle, airBrakes);
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement