//------------------------------------------------- private void SpawnParticles(GameObject particlePrefab, SoundPlayOneshot sound) { // Don't do this twice if (bParticlesSpawned) { return; } bParticlesSpawned = true; if (particlePrefab != null) { GameObject particleObject = Instantiate(particlePrefab, transform.position, transform.rotation) as GameObject; particleObject.GetComponent <ParticleSystem>().Play(); Destroy(particleObject, 2f); } if (sound != null) { float lastSoundDiff = Time.time - s_flLastDeathSound; if (lastSoundDiff < 0.1f) { sound.volMax *= 0.25f; sound.volMin *= 0.25f; } sound.Play(); s_flLastDeathSound = Time.time; } }
private void SpawnParticles(GameObject particlePrefab, SoundPlayOneshot sound) { if (this.bParticlesSpawned) { return; } this.bParticlesSpawned = true; if (particlePrefab != null) { GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(particlePrefab, base.transform.position, base.transform.rotation); gameObject.GetComponent <ParticleSystem>().Play(); UnityEngine.Object.Destroy(gameObject, 2f); } if (sound != null) { float num = Time.time - Balloon.s_flLastDeathSound; if (num < 0.1f) { sound.volMax *= 0.25f; sound.volMin *= 0.25f; } sound.Play(); Balloon.s_flLastDeathSound = Time.time; } }
void InitSound() { if (oneshotSound == null) { oneshotSound = GetComponent <Valve.VR.InteractionSystem.SoundPlayOneshot>(); } if (oneshotSound == null) { oneshotSound = gameObject.AddComponent <Valve.VR.InteractionSystem.SoundPlayOneshot>(); } if (waveFiles == null) { waveFiles = AudioClipGroup.Instance.hoverClickSounds; } oneshotSound.waveFiles = waveFiles; oneshotSound.playAllSoundsInArrayAtOnce = false; }
//Sound handled by the SoundPlayOneshot script void ConfigureSound() { #if UNITY_EDITOR if (!Application.isPlaying) { return; } #endif if (oneshotSound == null) { oneshotSound = GetComponent <Valve.VR.InteractionSystem.SoundPlayOneshot>(); } if (oneshotSound == null) { oneshotSound = gameObject.AddComponent <Valve.VR.InteractionSystem.SoundPlayOneshot>(); } if (waveFiles == null) { waveFiles = AudioClipGroup.Instance.hoverClickSounds; } oneshotSound.waveFiles = waveFiles; oneshotSound.playAllSoundsInArrayAtOnce = false; }
} // 0x0000000180FB7230-0x0000000180FB72D0 private void SpawnParticles(GameObject particlePrefab, SoundPlayOneshot sound) { } // 0x0000000180FB6F10-0x0000000180FB7190