Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created April 13, 2018 14:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save todorok1/bd7be6b4d05a9686a48ebcc1c7b2e866 to your computer and use it in GitHub Desktop.
Unityチュートリアル・ボールの飛距離とハイスコアをゲーム画面に表示するスクリプト。
// DistanceTextオブジェクトへの参照
[SerializeField]
GameObject distanceTextObject;
// HighScoreTextオブジェクトへの参照
[SerializeField]
GameObject highScoreTextObject;
// 以下、string distanceSuffix = " m"; まで省略
// HighScoreTextオブジェクトのTextコンポーネントへの参照をキャッシュ
Text highScoreText;
// ハイスコア表示のプレフィックス
string highScorePrefix = "High Score : ";
// ハイスコア表示のサフィックス
string highScoreSuffix = " m";
// ハイスコアの距離
float highScoreDistance = 0f;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment