/// <summary> /// This Method is very similar to PlayerDeath, except that it doesn't reload the level. In earlier designs the level just reloaded when you died, and then /// later the endGameCanvas was added. /// </summary> public void PlayerDeathEffectsOnly() { //Call chromatic abberation Method on ChromAbb script on MainCam chromo.StartAbberation(); //Call camera shake Method on camera shake script on MainCam shake.StartShake(); //if there is a death-clip then play sound if (deathSound) { AudioSource.PlayClipAtPoint(deathSound, transform.position, localSoundVolume * 2f); } //Spawn the exploding balls particle system Instantiate(deathParticles, transform.position, transform.rotation); //spawn the bright white flash plane Instantiate(flashObject, transform.position + new Vector3(0, 7f, 0), transform.rotation); //disable gameobject gameObject.SetActive(false); //player dead equals true isPlayerDead = true; }
public void PlayerDeathEffectsOnly() { chromo.StartAbberation(); shake.StartShake(); if (deathSound) { AudioSource.PlayClipAtPoint(deathSound, transform.position, localSoundVolume * 2f); } Instantiate(deathParticles, transform.position, transform.rotation); Instantiate(flashObject, transform.position + new Vector3(0, 7f, 0), transform.rotation); gameObject.SetActive(false); isPlayerDead = true; }