Exemplo n.º 1
0
 public void BuyReboot()
 {
     if (info.money >= rebootValue)
     {
         if (info.AudioOn)
         {
             GameObject.Find("audio_buyReboot").GetComponent <AudioSource>().Play();
         }
         info.money -= rebootValue;
         info.endlessReboot++;
         rebootValue = 5000 + 5000 * info.endlessReboot / 10;
         Reboot_cloud_text.GetComponent <Text>().text       = rebootValue.ToString();
         Reboot_count.GetComponent <Text>().text            = info.endlessReboot.ToString();
         Reboot_cloud_money_text.GetComponent <Text>().text = info.money.ToString();
         int rand = Random.Range(0, 3);
         if (rand == 0)
         {
             Reboot_buy.GetComponent <Image>().sprite = cloud1;
         }
         else if (rand == 1)
         {
             Reboot_buy.GetComponent <Image>().sprite = cloud2;
         }
         else
         {
             Reboot_buy.GetComponent <Image>().sprite = cloud3;
         }
         info.Save();
     }
 }
Exemplo n.º 2
0
    public void OnEnable()
    {
        //SCORE
        Text scoreText = GameObject.Find("Score").GetComponent <Text>();

        if (scoreNum < 10)
        {
            switch (scoreNum) //341A4B 52f/255f,26f/255f,75f/255f
            {
            case 0: scoreText.color = new Color(52f / 255f, 46f / 255f, 75f / 255f); break;

            case 1: scoreText.color = new Color(72f / 255f, 66f / 255f, 75f / 255f); break;

            case 2: scoreText.color = new Color(92f / 255f, 86f / 255f, 75f / 255f); break;

            case 3: scoreText.color = new Color(112f / 255f, 106f / 255f, 75f / 255f); break;

            case 4: scoreText.color = new Color(132f / 255f, 126f / 255f, 75f / 255f); break;

            case 5: scoreText.color = new Color(152f / 255f, 146f / 255f, 75f / 255f); break;

            case 6: scoreText.color = new Color(172f / 255f, 166f / 255f, 75f / 255f); break;

            case 7: scoreText.color = new Color(192f / 255f, 186f / 255f, 75f / 255f); break;

            case 8: scoreText.color = new Color(212f / 255f, 206f / 255f, 75f / 255f); break;

            case 9: scoreText.color = new Color(232f / 255f, 226f / 255f, 75f / 255f); break;

            default: scoreText.color = new Color(52f / 255f, 46f / 255f, 75f / 255f); break;
            }
        }
        else if (scoreNum <= 15)
        {
            scoreText.color = new Color(65f / 255f, 0f / 255f, 255f / 255f);
        }
        else if (scoreNum <= 20)
        {
            scoreText.color = new Color(0f / 255f, 112f / 255f, 255f / 255f);
        }
        else if (scoreNum <= 30)
        {
            scoreText.color = new Color(0 / 255f, 255f / 255f, 255f / 255f);
        }
        else
        {
            scoreText.color = new Color(228f / 255f, 0f / 255f, 255f / 255f);
        }
        scoreText.text = scoreNum.ToString();
        //REBOOT
        rebootValue = 5000 + 5000 * info.endlessReboot / 10;
        Reboot_cloud_text.GetComponent <Text>().text       = rebootValue.ToString();
        Reboot_count.GetComponent <Text>().text            = info.endlessReboot.ToString();
        Reboot_cloud_money_text.GetComponent <Text>().text = info.money.ToString();
        //OTHER
        noColorOnEndless = false;
    }