public void Dispose() { Network.Disconnect(); audioSource.Dispose(); foreach (var item in showCaseModelsList) { item.Dispose(); } showCaseModelsList.Clear(); if (!_isPlaying) { _MainMenu.Dispose(); } if (_GamePlayManager != null) { _GamePlayManager.Dispose(); } if (_RenderSystem != null) { _RenderSystem.Dispose(); } Network.OnServerStart -= OnServerStart; Network.OnDisconnect -= OnDsiconnect; Network.OnServerStop -= OnServerClose; Network.OnClientStart -= OnClientStart; Network.OnConnect -= OnConnect; }
protected override void OnStopped() { NetChannel.RemoveRemoteEvent("Client_GamemodeInfo"); NetChannel.RemoveRemoteEvent("Client_UpdateScores"); NetChannel.RemoveRemoteEvent("Client_IntelPickedUp"); NetChannel.RemoveRemoteEvent("Client_IntelDropped"); NetChannel.RemoveRemoteEvent("Client_IntelCaptured"); NetChannel.RemoveRemoteEvent("Client_IntelReturned"); objectComponent.RemoveInstantiationEvent("Client_CreateIntel"); objectComponent.RemoveInstantiationEvent("Client_CreateCommandPost"); redIntel = null; blueIntel = null; redPost = null; bluePost = null; TeamAScore = 0; TeamBScore = 0; ScoreCap = 3; OurPlayerHasIntel = false; intelAudioSource?.Dispose(); base.OnStopped(); }
public void Dispose() { AudioSource?.Bind(null); AudioSource?.Dispose(); AudioBuffer?.Dispose(); AudioSource = null; AudioBuffer = null; }
public override void Dispose() { if (!IsDisposed) { throwAudioSource?.Dispose(); } base.Dispose(); }
public void Dispose() { if (!isDisposed) { isDisposed = true; audioSource.Dispose(); } }
public override void Dispose() { if (!IsDisposed) { bounceAudioSource?.Dispose(); } base.Dispose(); }
public override void Dispose() { if (!IsDisposed) { hitBlockAudioSource?.Dispose(); missAudioSource?.Dispose(); } base.Dispose(); }
public void StartRecoding(String savePath) { FileSavePath = savePath + "BAR-" + DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss") + ".avi"; //图像 IImageProvider imgProvider = null; try { imgProvider = GetImageProvider(); } catch (Exception e) { MessageBox.Show(e.Message); imgProvider?.Dispose(); return; } //声音 IAudioProvider audioProvider = null; try { Settings.Audio.Enabled = true; if (Settings.Audio.Enabled && !Settings.Audio.SeparateFilePerSource) { audioProvider = _audioSource.GetMixedAudioProvider(); } } catch (Exception e) { MessageBox.Show(e.Message); _audioSource?.Dispose(); return; } //视频写入 IVideoFileWriter videoEncoder; try { videoEncoder = GetVideoFileWriterWithPreview(imgProvider, audioProvider); } catch (Exception e) { MessageBox.Show(e.Message); imgProvider?.Dispose(); audioProvider?.Dispose(); return; } _recorder = new Recorder(videoEncoder, imgProvider, Settings.Video.FrameRate, audioProvider); _recorder.Start(); }
public override void Dispose() { if (!IsDisposed) { fireAudioSource?.Dispose(); fireFarAudioSource?.Dispose(); reloadAudioSource?.Dispose(); dryFireAudioSource?.Dispose(); } base.Dispose(); }
public void OnCheckpointLoad(CheckpointCrate checkpoint) { if (audioSourceOnPicked != null) { if (audioSourceOnPicked.IsPlaying) { audioSourceOnPicked.Stop(); } audioSourceOnPicked.Dispose(); audioSourceOnPicked = null; } }
public override void Dispose() { if (!isDisposed) { isDisposed = true; jumpAudioSource?.Dispose(); landAudioSource?.Dispose(); walkingAudioSource.Dispose(); runningAudioSource.Dispose(); } base.Dispose(); }
public void StopAudio(bool dispose = true) { if (audioSource != null) { audioSource.Stop(); if (dispose) { audioSource.Dispose(); } } CheckVolume = false; }
void ICheckpointLoadable.OnCheckpointLoad(CheckpointCrate checkpoint) { if (checkpoint == null || checkpoint.Position.X < Position.X) { IsActive = true; crateTriggered = false; crate.IsActive = false; timeToTriggered = TIME_TO_TRIGGER_CRATE; } if (audioSource != null) { audioSource.Stop(); audioSource.Dispose(); audioSource = null; } }
public void Dispose() { _recordingModel.Dispose(); if (_hotkeys) { _hotKeyManager.Dispose(); } _audioSource.Dispose(); _recentList.Dispose(); // Remember things if not console. if (_persist) { _rememberByName.Remember(); _settings.Save(); } }
protected override void Dispose(bool disposing) { if (mDisposed) { return; } if (disposing) { mSoundManager.RemoveSound(mGlobalSoundSource); mGlobalSoundSource.Dispose(); mGlobalSoundSourceBuffer.Dispose(); foreach (var actorBatch in mActorBatches) { actorBatch.mMesh.Dispose(); } } base.Dispose(disposing); }
public void Dispose() { SystemEvents.PowerModeChanged -= SystemEvents_PowerModeChanged; if (_hotkeys) { HotKeyManager.Dispose(); } AudioSource.Dispose(); RecentViewModel.Dispose(); // Remember things if not console. if (_persist) { Remember(); Settings.Save(); } }
public void Dispose() { RecordingViewModel.Dispose(); if (_hotkeys) { HotKeyManager.Dispose(); } AudioSource.Dispose(); RecentViewModel.Dispose(); // Remember things if not console. if (_persist) { _rememberByName.Remember(); Settings.Save(); } }
public static void RemoveAll() { for (int i = 0; i < audioSourcesToDispose.Count; i++) { if (audioSourcesToDispose[i] == null) { audioSourcesToDispose.Remove(audioSourcesToDispose[i]); i--; } else if (!audioSourcesToDispose[i].IsPlaying) { audioSourcesToDispose[i].Dispose(); audioSourcesToDispose.Remove(audioSourcesToDispose[i]); i--; } } audioSourcesToDispose.Clear(); audioBackground.Dispose(); audioBackground = null; clipBackground = null; }
protected override void OnCheckpointLoad(CheckpointCrate checkpoint) { base.OnCheckpointLoad(checkpoint); countdownStarted = false; if (audioSourceCountDown != null) { if (audioSourceCountDown.IsPlaying) { audioSourceCountDown.Stop(); } audioSourceCountDown.Dispose(); audioSourceCountDown = null; } if (checkpoint == null || checkpoint.Position.X < Position.X) { Animation.Reset(); Animation.IsActive = false; countdownStarted = false; ((ExplosionCrate)brokenCrate).ResetObjectAlreadyHitted(); } }
public WavView(AssetViewContext context) { _source = context.Game.Audio.PlayFile(context.Entry.FilePath, true); AddDisposeAction(() => _source.Dispose()); }
public void Dispose() => AudioSource.Dispose();