// Destroys Phonon Manager. public void Destroy() { --referenceCount; if (referenceCount == 0) { if (audioEngineState != null) { audioEngineState.Destroy(); audioEngineState = null; } gameEngineState.Destroy(); componentCache.Destroy(); } }
public void Initialize(GameEngineStateInitReason reason, AudioEngine audioEngine, SimulationSettingsValue simulationValue, string[] sofaFileNames) { if (referenceCount == 0) { componentCache.Initialize(); gameEngineState.Initialize(simulationValue, componentCache, reason); if (reason == GameEngineStateInitReason.Playing) { audioEngineState = AudioEngineStateFactory.Create(audioEngine); audioEngineState.Initialize(componentCache, gameEngineState, sofaFileNames); } } ++referenceCount; }