Created
April 18, 2018 10:03
-
-
Save todorok1/fa30f004fb89837a5d8f12a3bf29976b 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
List<float> GetTimeProtsList(Vector3 speed, Vector3 gravity, int prots){ | |
// 斜方投射後、地面に到達する時刻を計算 | |
float landingTime = -2.0f * speed.y / gravity.y; | |
// 時刻格納用のリストを作成 | |
List<float> timeProtsList = new List<float>(); | |
// ガイドのプロット数が0なら作成直後の長さ0のリストを返す | |
if (prots <= 0){ | |
return timeProtsList; | |
} | |
// プロット数に応じて、ガイドを表示する位置を計算するための時刻をリストに追加 | |
for (int i = 1; i <= prots; i++){ | |
float timeProt = i * landingTime / prots; | |
timeProtsList.Add(timeProt); | |
} | |
return timeProtsList; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment