Beispiel #1
0
    public void InScore(int MyScore)  // 점수 받는 함수
    {
        MinSec TimeScore = new MinSec();

        TimeScore.CalcTime(MyScore);

        list.Add(MyScore);
        for (int i = 1; i <= 10; i++)
        {
            LoadPlayerPrefs("Rank" + i);
        }

        list.Sort();
        list.Reverse();

        SaveRankPlayerPrefs();

        if (MyScore > 0)
        {
            TextMyScore.SetActive(true);
            string min = TimeScore.Min.ToString().PadLeft(2, '0');
            string sec = TimeScore.Sec.ToString().PadLeft(2, '0');
            Myscore.text = string.Format("{0}' {1}''", min, sec);
        }
        else
        {
            TextMyScore.SetActive(false);
            Myscore.text = "";
        }

        Rank();
    }
Beispiel #2
0
    public void ShowTime(int time)
    {
        MinSec ms = new MinSec();

        ms.CalcTime(time);

        MinText.text = string.Format("{0}'", ms.Min).PadLeft(3, '0');
        SecText.text = string.Format("{0}''", ms.Sec).PadLeft(4, '0');
    }
Beispiel #3
0
    public void Rank() // 리스트 정렬 후 역순, 10개 점수를 출력.
    {
        for (int i = 0; i < 10; i++)
        {
            int    score = list[i];
            MinSec ms    = new MinSec();
            ms.CalcTime(score);

            string min  = ms.Min.ToString().PadLeft(2, '0');
            string sec  = ms.Sec.ToString().PadLeft(2, '0');
            string time = string.Format("{0}' {1}''", min, sec);
            ScoreText[i].text = "Score : " + time;
        }
    }