Esempio n. 1
0
    void OnMouseDown()
    {
        NumOfClick += 1f;

        if (gameObject.name.Equals("Virus(Clone)"))
        {
            GameObject VirusExplosion = Instantiate(explosionVirus, transform.position, transform.rotation) as GameObject;
            Destroy(this.gameObject);
            Destroy(VirusExplosion, 0.407f);
            healthControl.IncreaseLife();
            voice.VirusVoice();
        }


        else if (NumOfClick == 2f)
        {
            GameObject BigVirusExplosion = Instantiate(explosionVirus, transform.position, transform.rotation) as GameObject;
            Destroy(this.gameObject);
            Destroy(BigVirusExplosion, 0.407f);
            healthControl.BigVirusIncreaseLife();
            voice.VirusVoice();
        }

        if (gameObject.name.Equals("redblood(Clone)"))
        {
            GameObject RedBloodExplosion = Instantiate(explosionRedBlood, transform.position, transform.rotation) as GameObject;
            Destroy(this.gameObject);
            Destroy(RedBloodExplosion, 0.413f);
            healthControl.DecreaseLife();
            voice.RedBloodVoice();
        }
    }