Input.GetKeyDown( キーの指定 )
Input.GetKeyUp( キーの指定 )
※リストが表示されない場合
AddBlockなどの広告ブロックツールがONになっているとリストなどが表示されない場合があります。これらのツールをOFFにしてみてください。
void Update () {
if (Input.GetKeyDown(KeyCode.RightArrow)){
this.transform.Rotate(new Vector3(0, 0, -10f));
}
if (Input.GetKeyDown(KeyCode.LeftArrow)){
this.transform.Rotate(new Vector3(0, 0, 10f));
}
if (Input.GetKeyDown(KeyCode.UpArrow)){
this.transform.Translate(this.transform.up * 0.1f);
}
if (Input.GetKeyDown(KeyCode.DownArrow)){
this.transform.Translate(this.transform.up * -0.1f);
}
}
| << 前へ | 次へ >> |