Last active
December 30, 2016 15:01
-
-
Save tsubaki/7d6ed82aa50f96750b9770c0d7396a2c to your computer and use it in GitHub Desktop.
飛行機を飛ばす奴
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityStandardAssets.Vehicles.Aeroplane; | |
using UnityStandardAssets.CrossPlatformInput; | |
public class Controller : MonoBehaviour { | |
AeroplaneController controller; | |
private void Awake() | |
{ | |
controller = GetComponent<AeroplaneController>(); | |
} | |
void FixedUpdate() | |
{ | |
var pitch = Input.GetAxis("Vertical") ; | |
var roll = Input.GetAxis("Horizontal") ; | |
// ロール, ピッチ, ヨー, スロットル, エアブレーキ | |
controller.Move(roll, pitch, 0, 1, false); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment