Exemplo n.º 1
0
 public StarInfo GetStarbyUID(Guid uid)
 {
     return(TotalStars.Find(s => s.UniqueID == uid));
 }
Exemplo n.º 2
0
    IEnumerator showStars(int numStars)
    {
        float pause = 0.85f;

        yield return(new WaitForSeconds(pause));


        // get current # of stars earned and show it here
        int totalStars = PlayerPrefs.GetInt("totalStars");

        TotalStars.GetComponent <Text>().text = "" + totalStars;
        float tempGold = 0;
        float starGold = 100;

        switch (numStars)
        {
        case 1:
            Star1Fill.SetActive(true);
            tempGold = float.Parse(TotalGold.GetComponent <Text>().text) + starGold * .25f;
            PlayerPrefs.SetInt("totalGold", (int)tempGold);
            TotalGold.GetComponent <Text>().text = tempGold.ToString("N0");
            break;

        case 2:
            Star1Fill.SetActive(true);
            tempGold = float.Parse(TotalGold.GetComponent <Text>().text) + starGold * .25f;
            PlayerPrefs.SetInt("totalGold", (int)tempGold);
            TotalGold.GetComponent <Text>().text = tempGold.ToString("N0");

            yield return(new WaitForSeconds(pause));

            Star2Fill.SetActive(true);
            tempGold = float.Parse(TotalGold.GetComponent <Text>().text) + starGold * .6f;
            PlayerPrefs.SetInt("totalGold", (int)tempGold);
            TotalGold.GetComponent <Text>().text = tempGold.ToString("N0");
            break;

        case 3:
            Star1Fill.SetActive(true);
            tempGold = float.Parse(TotalGold.GetComponent <Text>().text) + starGold * .25f;
            PlayerPrefs.SetInt("totalGold", (int)tempGold);
            TotalGold.GetComponent <Text>().text = tempGold.ToString("N0");
            yield return(new WaitForSeconds(pause));

            Star2Fill.SetActive(true);
            tempGold = float.Parse(TotalGold.GetComponent <Text>().text) + starGold * .6f;
            PlayerPrefs.SetInt("totalGold", (int)tempGold);
            TotalGold.GetComponent <Text>().text = tempGold.ToString("N0");
            yield return(new WaitForSeconds(pause));

            Star3Fill.SetActive(true);
            Star1Fill.SetActive(true);
            tempGold = float.Parse(TotalGold.GetComponent <Text>().text) + starGold;
            PlayerPrefs.SetInt("totalGold", (int)tempGold);
            TotalGold.GetComponent <Text>().text = tempGold.ToString("N0");
            break;

        default:
            break;
        }

        Text textPlayer = textCodePlayer.GetComponent <Text>();

        StartCoroutine(ShowCode(false, false, allCode, textPlayer));

        yield return(new WaitForSeconds(pause * allCode.Count));

        Text textCode = textCodeSolution.GetComponent <Text>();

        StartCoroutine(ShowCode(false, true, levelController.Current.solutionCode, textCode));
    }