protected virtual void OnCollisionEnter(Collision collision) { if (collision.gameObject.GetComponent <Player>()) { collision.gameObject.GetComponent <Player>().StartRespawnSequence(); meteorSound.PlayAudioClip(); } this.gameObject.SetActive(false); }
public virtual void PickUpIcon() { powerupObtainedSound.PlayAudioClip(); startShelfTimer = false; Destroy(this.transform.GetChild(0).gameObject); ActivatePowerup(); }
private void FireLasers() { canFire = false; laserFiring.PlayAudioClip(); CreateLaser(Laser.LaserPosition.TOP); CreateLaser(Laser.LaserPosition.BOTTOM); }
void Start() { countdown.PlayAudioClip(); GameManager.Instance.startGametime = false; GameManager.Instance.StopPlayerMovement(); StartCoroutine(DelayLevel()); }
public virtual Missle Shoot(Vector2 direction, float speed) { missleFireSound.PlayAudioClip(); Missle b = CreateMissle(); b.direction = direction; b.speed = speed; return(b); }
void OnTriggerEnter(Collider collision) { rockExplosion.PlayAudioClip(); //If hit by bullet if (collision.gameObject.GetComponent <Bullet>()) { Destroy(this.gameObject); } }
private void StartExplosionCountdown() { timeUntilExplosion -= Time.deltaTime; if (timeUntilExplosion < 0) { missleExplosionSound.PlayAudioClip(); PrepareToRemoveObjects(); DestroyEverything(); Destroy(this.gameObject); } }
public void SetUpLaserAssault(Player.PlayerIdentity identity, float laserBeamSpeed, float laserLifespan, float topRotation, float bottomRotation) { playerWhoSpawnedIt = identity; laserSpeed = laserBeamSpeed; laserLife = laserLifespan; topLaserRotation = topRotation; bottomLaserRotation = bottomRotation; laserAppear = AudioManager.Instance.FindAudioClip(AudioManager.SoundName.LaserAssaultAppear); laserCharging = AudioManager.Instance.FindAudioClip(AudioManager.SoundName.LaserAssaultCharge); laserFiring = AudioManager.Instance.FindAudioClip(AudioManager.SoundName.LaserAssaultFiring); laserAppear.PlayAudioClip(); }
void OnTriggerEnter(Collider collision) { //print("Red hit"); //If hit by bullet redShieldImpact.PlayAudioClip(); if (collision.gameObject.GetComponent <Bullet>()) { //print("Bullet Bounce"); collision.GetComponent <Bullet>().direction.y += .3f * this.GetComponent <DestructableShields>().direction.y; collision.GetComponent <Bullet>().direction.x -= collision.GetComponent <Bullet>().direction.x * 1.5f; } }
public void StartMeteorStrike() { //this method called when player picks up Meteor Strike powerup icon, starts meteor strike //takes all spawners in metorSpawner, random generator to decide which get chosen to fire //upon each firing, resets timer to 1 second //once 12 meteors have been shot, meteor strike ends meteorStrikeSound.PlayAudioClip(); iconPickedUp = true; spawnScore++; shotTimer = 1; int spawnerPicked; spawnerPicked = UnityEngine.Random.Range(0, meteorSpawners.Count); meteorSpawners[spawnerPicked].GetComponent <MeteorStrikeSpawner>().FireMeteor(); }
void OnTriggerEnter(Collider collision) { //If hit by bullet if (collision.gameObject.GetComponent <Bullet>()) { healthPoints--; } else if (collision.gameObject.GetComponent <Missle>()) { healthPoints = 0; } if (healthPoints > 0 && (collision.gameObject.GetComponent <Bullet>() || collision.gameObject.GetComponent <Missle>())) { shieldImpactSound.PlayAudioClip(); } else if ((collision.gameObject.GetComponent <Bullet>() || collision.gameObject.GetComponent <Missle>())) { shieldDestructionSound.PlayAudioClip(); } }
protected virtual void PlayPowerupSound() { powerupAppearSound = AudioManager.Instance.FindAudioClip(AudioManager.SoundName.PowerupAppear); powerupObtainedSound = AudioManager.Instance.FindAudioClip(AudioManager.SoundName.PowerupObtained); powerupAppearSound.PlayAudioClip(); }
public void StartRespawnSequence() { respawnTimer = respawnTime; state = PlayerState.RESPAWNING; deathSound.PlayAudioClip(); }
public void SpawnLasers() { laserCharging.PlayAudioClip(); SpawnLaserGuns(true); chargeTimer = true; }
private void PlayGunSound() { gunSound.PlayAudioClip(); }