Last active
May 1, 2018 13:14
-
-
Save todorok1/429d90fc9fe834f8851971a968ab6d1c 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
// オブジェクト参照のエリアに追加 | |
// 発射ボタンオブジェクトへの参照 | |
[SerializeField] | |
GameObject boostButtonObject; | |
// ゴール用UIテキストオブジェクトへの参照 | |
[SerializeField] | |
GameObject goalTextObject; | |
// 中略 | |
// Sphereオブジェクトの初期位置格納用ベクトル | |
// Vector3 initPosition = Vector3.zero; | |
// -> initPositionを削除 | |
// 中略 | |
// 角度の上限と下限の定義 | |
const float MaxAngle = 180f; | |
const float MinAngle = 0f; | |
// 中略 | |
// GuideManagerへの参照のキャッシュ | |
GuideManager guideManager; | |
// 以下を追加 | |
// ボールを発射する直前の位置 | |
Vector3 prePosition = Vector3.zero; | |
// 発射ボタンオブジェクトへの参照 | |
Button boostButton; | |
// ボタンを押せる状態かどうかのフラグ | |
bool canButtonPress = true; | |
// ゴールのタグ | |
string goalTag = "Finish"; | |
// ゴール接触フラグ | |
bool isTouchingGoal = false; | |
// ゴール済みフラグ | |
bool hasReachedGoal = false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment