Exemple #1
0
 IEnumerator Make_Explosion()
 {
     if (input == "V" && Getmoney.money >= 200)
     {
         Getmoney.money -= 200;
         GameObject tmp = Instantiate(obj, transform.localPosition, Quaternion.identity);
         GetComponent <AudioSource>().PlayOneShot(DeathSound);
     }
     else if (input == "V" && Getmoney.money < 200)
     {
         StartCoroutine(Showmoneylittle());
     }
     if (input == "B" && Getmoney.money >= 100)
     {
         Getmoney.money -= 100;
         GameObject tmp = Instantiate(obj, transform.localPosition, Quaternion.identity);
         GetComponent <AudioSource>().PlayOneShot(DeathSound);
     }
     else if (input == "B" && Getmoney.money < 100)
     {
         StartCoroutine(Showmoneylittle());
     }
     Getmoney.setMoney();
     yield return(null);
 }
Exemple #2
0
    IEnumerator Make_Explosion()
    {
        GetComponent <AudioSource>().PlayOneShot(DeathSound);
        Getmoney.money -= 20;
        Getmoney.setMoney();
        GameObject tmp = Instantiate(obj, transform.localPosition, Quaternion.identity);

        yield return(new WaitForSeconds(1.5f));

        Destroy(tmp);
    }