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
// PowerMeterオブジェクトへの参照 | |
[SerializeField] | |
GameObject powerMeterObject; | |
// ここから追加 | |
// 角度を表す矢印オブジェクト | |
[SerializeField] | |
GameObject angleArrowObject; | |
// 角度変更ボタン(上) | |
[SerializeField] | |
GameObject angleArrowUpButtonObject; | |
// 角度変更ボタン(下) | |
[SerializeField] | |
GameObject angleArrowDownButtonObject; | |
// GuideParentオブジェクトへの参照 | |
[SerializeField] | |
GameObject guideManagerObject; | |
// 追加ここまで | |
// 中略 | |
// [SerializeField]を外す | |
// X軸からの角度 | |
float forceAngle = 45.0f; | |
// 中略 | |
// 角度増加中か減少中か | |
const int AngleIncreasing = 1; | |
const int AngleDecreasing = -1; | |
// 角度の増分 | |
int angleDelta; | |
// 矢印オブジェクトのRect Transformへの参照のキャッシュ | |
RectTransform arrowRt; | |
// 角度の上限と下限の定義 | |
const float MaxAngle = 90f; | |
const float MinAngle = 0f; | |
// Buttonコンポーネントへの参照のキャッシュ | |
Button angleUpButton; | |
Button angleDownButton; | |
// GuideManagerへの参照のキャッシュ | |
GuideManager guideManager; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment