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();
        }
示例#3
0
 public void Dispose()
 {
     AudioSource?.Bind(null);
     AudioSource?.Dispose();
     AudioBuffer?.Dispose();
     AudioSource = null;
     AudioBuffer = null;
 }
示例#4
0
        public override void Dispose()
        {
            if (!IsDisposed)
            {
                throwAudioSource?.Dispose();
            }

            base.Dispose();
        }
示例#5
0
        public void Dispose()
        {
            if (!isDisposed)
            {
                isDisposed = true;

                audioSource.Dispose();
            }
        }
示例#6
0
        public override void Dispose()
        {
            if (!IsDisposed)
            {
                bounceAudioSource?.Dispose();
            }

            base.Dispose();
        }
示例#7
0
        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();
        }
示例#9
0
        public override void Dispose()
        {
            if (!IsDisposed)
            {
                fireAudioSource?.Dispose();
                fireFarAudioSource?.Dispose();
                reloadAudioSource?.Dispose();
                dryFireAudioSource?.Dispose();
            }

            base.Dispose();
        }
示例#10
0
        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();
        }
示例#12
0
        public void StopAudio(bool dispose = true)
        {
            if (audioSource != null)
            {
                audioSource.Stop();

                if (dispose)
                {
                    audioSource.Dispose();
                }
            }

            CheckVolume = false;
        }
示例#13
0
        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;
            }
        }
示例#14
0
        public void Dispose()
        {
            _recordingModel.Dispose();

            if (_hotkeys)
            {
                _hotKeyManager.Dispose();
            }

            _audioSource.Dispose();

            _recentList.Dispose();

            // Remember things if not console.
            if (_persist)
            {
                _rememberByName.Remember();

                _settings.Save();
            }
        }
示例#15
0
        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);
        }
示例#16
0
        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();
            }
        }
示例#17
0
        public void Dispose()
        {
            RecordingViewModel.Dispose();

            if (_hotkeys)
            {
                HotKeyManager.Dispose();
            }

            AudioSource.Dispose();

            RecentViewModel.Dispose();

            // Remember things if not console.
            if (_persist)
            {
                _rememberByName.Remember();

                Settings.Save();
            }
        }
示例#18
0
        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;
        }
示例#19
0
        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();
            }
        }
示例#20
0
        public WavView(AssetViewContext context)
        {
            _source = context.Game.Audio.PlayFile(context.Entry.FilePath, true);

            AddDisposeAction(() => _source.Dispose());
        }
示例#21
0
 public void Dispose() => AudioSource.Dispose();