Created
April 24, 2018 12:13
-
-
Save todorok1/006291b36f4af366a9a7c5b9f7017c4f 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)){ | |
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