Ejemplo n.º 1
0
    void Start()
    {
        Ranking ranking = RankingDataStore.GetRanking();

        Debug.Log(ranking);

        ranking.points.Sort((a, b) => b - a);

        if (ranking.points.Count <= 5)
        {
            int rest = 5 - ranking.points.Count;
            for (int i = 0; i < rest; i++)
            {
                ranking.points.Add(5 - i);
            }
        }

        ranking.points.Sort((a, b) => b - a);

        string text = "";

        for (int i = 0; i < ranking.points.Count; i++)
        {
            text += i + 1 + ". " + ranking.points[i] + "てん\n";
        }

        Text rankingText = GetComponent <Text> ();

        rankingText.text = text;
    }
Ejemplo n.º 2
0
    void Update()
    {
        this.totalTime += Time.deltaTime;

        if (CircleImage.fillAmount > 0)
        {
            if (this.totalTime > 3.5f)
            {
                CircleImage.fillAmount -= 1.0f / countTime * Time.deltaTime;
            }
        }
        else
        {
            if (GameTimerController.isFinish == false)
            {
                AudioSource audioSource = GetComponent <AudioSource> ();
                audioSource.PlayOneShot(audioSource.clip);

                this.point.text = Score.point + "てん";
                this.gameover.SetActive(true);

                RankingDataStore.AddPoint(Score.point);

                GameTimerController.isFinish = true;
            }
        }
    }
Ejemplo n.º 3
0
    public static void AddPoint(int point)
    {
        Ranking ranking = RankingDataStore.GetRanking();

        ranking.points.Add(point);

        string json = JsonUtility.ToJson(ranking);

        Debug.Log("JSON STRING: " + json);
        PlayerPrefs.SetString(RankingDataStore.KEY, json);
        PlayerPrefs.Save();
    }