Unity Tutorial Beginner Space Shooter chapter 16,17で学んだ事
対象のキーボード入力があったかどうかをチェックするには、Input.GetKeyDown (押した瞬間を確認。押しっぱなしでも1回入力として扱う)を使う。
例えば、'R'が入力されたかどうかの判定は下記の通り。
Input.GetKeyDown(KeyCode.R))
Input.GetKeyDown
https://docs.unity3d.com/Documentation/ScriptReference/Input.GetKeyDown.htmlUnity - 入力情報を取得する
http://www40.atwiki.jp/spellbound/pages/1333.htmlUnity: 3分で覚えるキーボード入力スクリプト
http://hamken100.blogspot.jp/2012/05/unity-3.htmlUnity初心者が学ぶ「Inputの正しい用法」
http://gamesonytablet.blogspot.jp/2012/12/unityinput.html
ゲームオーバー状態から、リスタートでゲームの最初からの状態に戻す場合は、
下記のようにloadedLevelに戻してあげればおk。
Application.LoadLevelはシーン移動にも使える。
Application.LoadLevel(Application.loadedLevel);
Application.LoadLevel
http://docs.unity3d.com/Documentation/ScriptReference/Application.LoadLevel.html[Unity3D]引数付きシーン呼び出し
http://terasur.blog.fc2.com/blog-entry-87.html
以上でSpace Shooterのチュートリアル終わり。たくさんの事が学べて良かった。