public override void Activate() { base.Activate(); if (!activated) { levelAudioSource.Stop(); levelAudioSource.clip = firstMusic; levelAudioSource.volume = firstMusicVolumeBeforeDeath; levelAudioSource.Play(); activated = true; myAnim.SetTrigger("PopTrigger"); myAttractionCircle.ChangeRadius(popTriggerRadius); myAttractionCircle.ChangeRepulse(false); } else { Deactivate(); } }
public override void Die() { if (myAttractionCircle != null) { myAttractionCircle.ChangeScore(scoreOnceDestroyed); myAttractionCircle.ChangeRadius(25); } GameObject _confettiParticlesRef = Instantiate(confettiParticlesPrefab, transform.position, Quaternion.Euler(-90, 0, 0)); Destroy(_confettiParticlesRef, 2.5f); print("beforePlay"); myAudioSource.PlayOneShot(dieAudioClip); print("afterPlay"); base.Die(); if (containedObject != null) { Instantiate(containedObject, transform.position, Quaternion.identity); } }