IEnumerator death()
    {
        playDestructionParticle();
        yield return(new WaitForSecondsRealtime(.2f));

        Destroy(this.gameObject);
        PlayerPrefs.SetInt("Score", PlayerPrefs.GetInt("Score") + 1000);
        PlayerPrefs.SetInt("coins", PlayerPrefs.GetInt("coins") + 5);
        PlayerPrefs.SetInt("EndlessScore", PlayerPrefs.GetInt("EndlessScore") + 1);
        if (1 == PlayerPrefs.GetInt("InScene"))
        {
            uf.aliendead();
        }
    }
Пример #2
0
    IEnumerator death()
    {
        yield return(new WaitForSecondsRealtime(.0001f));

        sp.sprite = explosion1;
        yield return(new WaitForSecondsRealtime(.5f));

        sp.sprite = explosion2;
        yield return(new WaitForSecondsRealtime(.5f));

        Destroy(this.gameObject);

        PlayerPrefs.SetInt("Score", PlayerPrefs.GetInt("Score") + 1000);
        PlayerPrefs.SetInt("coins", PlayerPrefs.GetInt("coins") + 250);
        uf.aliendead();
    }
Пример #3
0
    IEnumerator death()
    {
        Destroy(damageText);
        yield return(new WaitForSecondsRealtime(.0001f));

        spr.sprite = explosion1;
        yield return(new WaitForSecondsRealtime(.1f));

        spr.sprite = explosion2;
        yield return(new WaitForSecondsRealtime(.1f));

        Destroy(this.gameObject);
        PlayerPrefs.SetInt("Score", PlayerPrefs.GetInt("Score") + 1000);
        PlayerPrefs.SetInt("coins", PlayerPrefs.GetInt("coins") + 5);
        PlayerPrefs.SetInt("EndlessScore", PlayerPrefs.GetInt("EndlessScore") + 1);

        if (1 == PlayerPrefs.GetInt("InScene"))
        {
            uf.aliendead();
        }
    }