Exemplo n.º 1
0
 public void PopBubble()
 {
     gameObject.GetComponent <Rigidbody2D>().isKinematic = false;
     gameObject.GetComponent <Animator>().enabled        = false;
     gameObject.GetComponent <Image>().enabled           = false;
     gameObject.GetComponent <Button>().interactable     = false;
     audioManager.PlayMusic(Random.Range(0, 2));
     gameObject.GetComponent <AudioSource>().Play();
     Instantiate(popParticle, transform.position, Quaternion.identity);
     Destroy(gameObject, 3f);
     gameManager.UpdateScore(1);
 }
Exemplo n.º 2
0
    public void Explode()
    {
        audioManager.PlayVoice(1);
        gameObject.GetComponent <Image>().enabled       = false;
        gameObject.GetComponent <Button>().interactable = false;
        audioManager.PlayVoice(1);
        gameObject.GetComponent <AudioSource>().Play();
        Instantiate(explodeParticle, transform.position, Quaternion.identity);
        GameObject splatter = Instantiate(poopSplatterPrefab, transform.position, Quaternion.identity);

        splatter.transform.SetParent(gameManager.canvas);
        splatter.transform.localScale = transform.localScale;
        Destroy(gameObject, 3f);
        gameManager.UpdateScore(-2);
    }