Ejemplo n.º 1
0
 /// <summary>
 /// 初始
 /// </summary>
 private void Initial()
 {
     if (PlayerPrefs.GetFloat("最快時間") == 0)
     {
         PlayerPrefs.SetFloat("最快時間", 99999);
     }
     sonicBoy  = FindObjectOfType <SonicBoy>();
     coinTotal = GameObject.FindGameObjectsWithTag(sonicBoy.coin).Length;
     if (textCoin)
     {
         textContentCoin = textCoin.text;
         textCoin.text   = textContentCoin + 0 + " / " + coinTotal;
     }
     if (textTime)
     {
         textContentTime = textTime.text;
     }
 }
Ejemplo n.º 2
0
    /// <summary>
    /// 初始
    /// </summary>
    private void Initial()
    {
        textTime  = GameObject.Find("時間文字").GetComponent <Text>();
        textCoin  = GameObject.Find("金幣文字").GetComponent <Text>();
        passPanel = GameObject.Find("過關畫面").transform;

        if (PlayerPrefs.GetFloat("最快時間") == 0)
        {
            PlayerPrefs.SetFloat("最快時間", 99999);
        }
        sonicBoy  = FindObjectOfType <SonicBoy>();
        coinTotal = GameObject.FindGameObjectsWithTag(sonicBoy.coin).Length;
        if (textCoin)
        {
            textContentCoin = textCoin.text;
            textCoin.text   = textContentCoin + 0 + " / " + coinTotal;
        }
        if (textTime)
        {
            textContentTime = textTime.text;
        }
    }