コード例 #1
0
ファイル: ScoreManager.cs プロジェクト: gkjolin/Loona
 // Use this for initialization
 void Start()
 {
     Score          = GameObject.FindGameObjectWithTag(ScoreTAG);
     ScoreGameOverr = GameObject.FindGameObjectWithTag("ScoreGameOver");
     HighScorer     = GameObject.FindGameObjectWithTag(HighScoreTAG);
     getPlayerPrefs();
     Score.GetComponent <Text>().text          = "Score " + Scorer.ToString();
     ScoreGameOverr.GetComponent <Text>().text = "Score " + Scorer.ToString();
     HighScorer.GetComponent <Text>().text     = "" + HighScore;
 }
コード例 #2
0
ファイル: ScoreManager.cs プロジェクト: gkjolin/Loona
 // Update is called once per frame
 public void SetScore(int ScoreToAdd)
 {
     Scorer = Scorer + ScoreToAdd;
     Score.GetComponent <Text>().text          = Scorer.ToString();
     ScoreGameOverr.GetComponent <Text>().text = "Score " + Scorer;
     if (Scorer >= HighScore)
     {
         HighScore = Scorer;
         setPlayerPrefs(Scorer);
         PlayerPrefs.Save();
     }
     HighScorer.GetComponent <Text>().text = "" + HighScore;
 }
コード例 #3
0
	// Use this for initialization
	
	void Start () {
		//find the magic
		DoMagical = GetComponent<Text> ();
		CanWin = true;
		SaveScore = GameObject.FindObjectOfType (typeof(HighScorer)) as HighScorer;
	}