コード例 #1
0
    // Use this for initialization
    void Start()
    {
        float time = float.PositiveInfinity;

        switch (difficulty)
        {
        case Difficulty.EASY:
            time = PlayerPrefs.GetFloat("easyscore", float.PositiveInfinity);
            break;

        case Difficulty.MEDIUM:
            time = PlayerPrefs.GetFloat("mediumscore", float.PositiveInfinity);
            break;

        case Difficulty.HARD:
            time = PlayerPrefs.GetFloat("hardscore", float.PositiveInfinity);
            Debug.Log(time);
            break;
        }
        if (time > 90000)
        {
            GetComponent <Text>().text = "-";
        }
        else
        {
            GetComponent <Text>().text = TimeScore.toString(time);
        }
    }
コード例 #2
0
ファイル: Game.cs プロジェクト: jslone/tetroku
 // increment timer
 void CountTime()
 {
     gameTime += Time.deltaTime;
     time.text = TimeScore.toString(gameTime);
 }