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 FixedUpdate(){ | |
// 距離の測定 | |
CheckDistance(); | |
// ゴールしたかどうかの確認 | |
CheckSphereState(); | |
if (!isBoostPressed){ | |
// キーまたはボタンが押されていなければ | |
// 処理の切り替えをせず抜ける | |
return; | |
} | |
// Boostボタンが押された場合に以下の処理を行う | |
canButtonPress = false; | |
boostButton.interactable = canButtonPress; | |
// ボールの発射処理 | |
BoostSphere(); | |
// 飛行中フラグの切り替え | |
isFlying = true; | |
// どちらの処理をしてもボタン押下フラグをfalseに | |
isBoostPressed = false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment