Created
May 1, 2018 13:03
-
-
Save todorok1/25b44341d4cd78d00cde7dfdb7ee81e9 to your computer and use it in GitHub Desktop.
Unityチュートリアル・ゴルフゲームの進行を制御するスクリプト
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
void CheckInput(){ | |
// キーが押された時の動きを定義 | |
// Input.GetKeyUpはキーが一度押された後、それが離された時にTrueを返す | |
if (Input.GetKeyUp(KeyCode.B) && canButtonPress){ | |
isBoostPressed = true; | |
} | |
// 上キーが押された時は、角度変更ボタン(上)が押された時の処理を呼ぶ | |
if (Input.GetKeyDown(KeyCode.UpArrow)){ | |
OnPressedAngleUpButton(); | |
} else if (Input.GetKeyUp(KeyCode.UpArrow)){ | |
OnReleasedAngleButton(); | |
} | |
// 下キーが押された時は、角度変更ボタン(下)が押された時の処理を呼ぶ | |
if (Input.GetKeyDown(KeyCode.DownArrow)){ | |
OnPressedAngleDownButton(); | |
} else if (Input.GetKeyUp(KeyCode.DownArrow)){ | |
OnReleasedAngleButton(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment