public void OnDeath(bool byProj) { if (!dead) { if (basicShield <= 0) { if (byProj) { target.gameObject.GetComponent <PlayerVariables>().Kill(); } dead = true; transform.GetChild(0).gameObject.SetActive(false); peepee.Play(); AudioSource source = GetComponent <AudioSource>(); source.Play(); if (Random.Range(0.0f, 100.0f) < EnemySpawn.PowerupSpawnFunc() && byProj) { spawnPowerup(); } } else { DecrementShield(); } } }