コード例 #1
0
 void Start()
 {
     pointsObtained     = 0;
     questionController = FindObjectOfType <QuestionController>();
     scoreHolderScript  = FindObjectOfType <PlayerPrefsScript>();
     txtDistance        = GameObject.FindGameObjectWithTag("Distance").GetComponent <TextMeshProUGUI>();
     txtStartMessage    = GameObject.FindGameObjectWithTag("StartMsg").GetComponent <TextMeshProUGUI>();
     txtPoints          = GameObject.FindGameObjectWithTag("Points").GetComponent <TextMeshProUGUI>();
     btnStart           = GameObject.FindGameObjectWithTag("StartButton").GetComponent <Button>();
     playerRigdbody     = GetComponent <Rigidbody>();
     playerAnimator     = GetComponent <Animator>();
 }
コード例 #2
0
 void Start()
 {
     txtScoreDisplay      = GetComponent <TextMeshProUGUI>();
     scoreHolderScript    = FindObjectOfType <PlayerPrefsScript>();
     txtScoreDisplay.text = scoreHolderScript.GetStoredScore().ToString("F1");
 }