Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Last active December 30, 2016 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubaki/7d6ed82aa50f96750b9770c0d7396a2c to your computer and use it in GitHub Desktop.
Save tsubaki/7d6ed82aa50f96750b9770c0d7396a2c to your computer and use it in GitHub Desktop.
飛行機を飛ばす奴
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