void GetShot(Vector3 _impactPoint, Vector3 otherSpeed) { Vector3 direction = self.position - _impactPoint; body.AddForce(direction.normalized * shootForce + otherSpeed / 2, ForceMode.VelocityChange); myAttractionCircle.ChangeScore(maxScore); cooldownBeforeMinScore = timeBeingAtMaxScore; }
public override void Activate() { base.Activate(); if (!activated) { myAttractionCircle.ChangeScore(maxScore); myRenderer.material.color = Color.yellow; activated = true; } else { Deactivate(); } }
public override void Die() { myAttractionCircle.ChangeScore(0); myAttractionCircle.ChangeRadius(0); Instantiate(explosionParticlePrefab, explosionTransform.position, Quaternion.identity); Instantiate(smokeParticlePrefab, explosionTransform.position, Quaternion.Euler(-90, 0, 0), transform); canActivate = false; levelAudioSource.Stop(); levelAudioSource.clip = levelMusic; levelAudioSource.Play(); levelAudioSource.volume = 0; StopCoroutine(MusicComingBack()); StartCoroutine(MusicComingBack()); myAnim.SetTrigger("NoMusicTrigger"); }
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); } }