Exemplo n.º 1
0
    protected override void OnTouch()
    {
        Squish();
        AudioSource audio = AudioSourceController.GetAudioSourceController().GetComponent <AudioSource>();

        audio.PlayOneShot(floaterSound, soundVolume);
    }
Exemplo n.º 2
0
    protected override void OnTouch()
    {
        if (alreadyTouched)
        {
            return;
        }

        alreadyTouched = true;
        GetComponent <PolygonCollider2D>().enabled = false;
        print("onTouch Bubble");
        AudioSource audio = AudioSourceController.GetAudioSourceController().GetComponent <AudioSource>();

        audio.PlayOneShot(bubbleSound, soundVolume);
        this.GetComponentInChildren <Animator>().SetTrigger("bubblepop");
        // Destroy(this.gameObject);
    }