Skip to content

Instantly share code, notes, and snippets.

@todorok1
Last active May 1, 2018 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todorok1/d5511c62b5fe167623146da3769f4fc1 to your computer and use it in GitHub Desktop.
Save todorok1/d5511c62b5fe167623146da3769f4fc1 to your computer and use it in GitHub Desktop.
Unityチュートリアル・ゴルフゲームの進行を制御するスクリプト
void Start(){
// initPositionの行を削除
// initPosition = gameObject.transform.position;
rb = gameObject.GetComponent<Rigidbody>();
distanceText = distanceTextObject.GetComponent<Text>();
highScoreText = highScoreTextObject.GetComponent<Text>();
powerMeterSlider = powerMeterObject.GetComponent<Slider>();
arrowRt = angleArrowObject.GetComponent<RectTransform>();
angleUpButton = angleArrowUpButtonObject.GetComponent<Button>();
angleDownButton = angleArrowDownButtonObject.GetComponent<Button>();
guideManager = guideManagerObject.GetComponent<GuideManager>();
// boostボタンのコンポーネントへの参照を追加
boostButton = boostButtonObject.GetComponent<Button>();
// DistanceTextとHighScoreTextの初期値をセット
SetDistanceText(0f);
SetHighScoreText(0f);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment