當前位置: 首頁>>代碼示例>>C#>>正文


C# Cue.SetVariable方法代碼示例

本文整理匯總了C#中Microsoft.Xna.Framework.Audio.Cue.SetVariable方法的典型用法代碼示例。如果您正苦於以下問題:C# Cue.SetVariable方法的具體用法?C# Cue.SetVariable怎麽用?C# Cue.SetVariable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Microsoft.Xna.Framework.Audio.Cue的用法示例。


在下文中一共展示了Cue.SetVariable方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Player

        public Player(Game1 game, Vector3 p, float s)
            : base(game)
        {
            this.game = game;
            MAX_SPEED = 10;
            theModel = game.Content.Load<Model>("Models\\Player\\ship");
            player_position = p;
            scale = s;

            funnelSmokePlume = new SmokePlumeParticleSystem(game, game.Content);
            funnelSmokePlume.DrawOrder=4;
            game.Components.Add(funnelSmokePlume);

            explosion = new ExplosionParticleSystem(game, game.Content);
            explosion.DrawOrder = 4;

            explosionSmoke = new ExplosionSmokeParticleSystem(game, game.Content);
            explosionSmoke.DrawOrder = 4;

            playerSfx = game.getSoundPlayer();
            trainSoundCue =  playerSfx.getCue("trainsSound");
            playerSfx.playCue(trainSoundCue);
            trainSoundCue.SetVariable("TrainSpeed", 0);
        }
開發者ID:ewencluley,項目名稱:Space1939,代碼行數:24,代碼來源:Player.cs

示例2: StartAllSound

        ///<summary>
        ///Start all tank engine sounds.
        ///</summary>
        public void StartAllSound()
        {
            if (_engineCue != null && !_engineCue.IsStopped)
            {
                _engineCue.Stop(AudioStopOptions.Immediate);
            }

            _engineCue = Program.SoundBank.GetCue("tankEngine");
            _engineCue.SetVariable("EngineSpeed", 0.0f);
            _engineCue.SetVariable("AngularSpeed", 0.0f);
            _engineCue.Play();
        }
開發者ID:funkjunky,項目名稱:Raven,代碼行數:15,代碼來源:EngineAudioComponent.cs

示例3: LoadSounds

        public static void LoadSounds(ContentManager content)
        {
            _audioEngine = new AudioEngine(content.RootDirectory + "//BomberbroAudio.xgs");
            _waveBankTheme = new WaveBank(_audioEngine, content.RootDirectory + "//Theme.xwb");
            _soundBankTheme = new SoundBank(_audioEngine, content.RootDirectory + "//Theme.xsb");
            _waveBankSoundEffect = new WaveBank(_audioEngine, content.RootDirectory + "//SoundEffects.xwb");
            _soundBankSoundEffect = new SoundBank(_audioEngine, content.RootDirectory + "//SoundEffect.xsb");

            _currentSong = _soundBankTheme.GetCue("Theme");
            _explosion2 = _soundBankSoundEffect.GetCue("Explosion 2");
            _cancel1 = _soundBankSoundEffect.GetCue("Cancel 1");
            _cancel2 = _soundBankSoundEffect.GetCue("Cancel 2");
            _collision1 = _soundBankSoundEffect.GetCue("Collision 1");
            _collision2 = _soundBankSoundEffect.GetCue("Collision 2");
            _completeDead = _soundBankSoundEffect.GetCue("Complete-Dead");
            _explosion1 = _soundBankSoundEffect.GetCue("Explosion 1");
            _hit = _soundBankSoundEffect.GetCue("Hit");
            _marioCoin = _soundBankSoundEffect.GetCue("Mario Coin");
            _randomMelody1 = _soundBankSoundEffect.GetCue("Random Melody 1");
            _randomMelody2 = _soundBankSoundEffect.GetCue("Random Melody 2");
            _sfx1 = _soundBankSoundEffect.GetCue("SFX1");
            _thumbMove1 = _soundBankSoundEffect.GetCue("ThumbMove 1");

            MusicVolume = 0.5f;
            MusicPitch = 0.5f;
            _audioEngine.GetCategory("Music").SetVolume(_musicVolume);
            _currentSong.SetVariable("Pitch", _musicPitch);
        }
開發者ID:faysalsultan,項目名稱:Bomberbro,代碼行數:28,代碼來源:BombermanSound.cs


注:本文中的Microsoft.Xna.Framework.Audio.Cue.SetVariable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。