当前位置: 首页>>代码示例>>C#>>正文


C# Cue.Play方法代码示例

本文整理汇总了C#中Microsoft.Xna.Framework.Audio.Cue.Play方法的典型用法代码示例。如果您正苦于以下问题:C# Cue.Play方法的具体用法?C# Cue.Play怎么用?C# Cue.Play使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Xna.Framework.Audio.Cue的用法示例。


在下文中一共展示了Cue.Play方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PlayMusic

        public static void PlayMusic(string name)
        {
            StopMusic();

            cue = soundBank.GetCue(name);
            cue.Play();
        }
开发者ID:jacobnelson,项目名称:WorldsApart,代码行数:7,代码来源:AudioManager.cs

示例2: PlayBuzzer

 public void PlayBuzzer()
 {
     fxCat.SetVolume(10f);
     cue = soundBank.GetCue("Buzzer");
     cue.Play();
     fxCat.SetVolume(6f);
 }
开发者ID:RandyRhombus,项目名称:Titans1,代码行数:7,代码来源:AudioManager.cs

示例3: playLoop

 static void playLoop(ref Cue cue) {
     if (!cue.IsPlaying) {
         StopLoops();
         InitCues();
         cue.Play();
     }
 }
开发者ID:Nailz,项目名称:MonoGame-Samples,代码行数:7,代码来源:GhostSoundsManager.cs

示例4: TriggerBossEvent

		public void TriggerBossEvent() {
			mBossEvent = true;
			mMusic.Pause();
			mBossMusic = mSounds.GetCue( "boss_music" );
			mMusicName = mBossMusic.Name;
			mBossMusic.Play();
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:7,代码来源:DefenderMusic.cs

示例5: FieldPong

        public FieldPong()
        {
            graphics = new GraphicsDeviceManager(this);
            content = new ContentManager(Services);

            graphics.PreferredBackBufferWidth = 1024;
            graphics.PreferredBackBufferHeight = 768;
            graphics.MinimumPixelShaderProfile = ShaderProfile.PS_2_0;
            graphics.SynchronizeWithVerticalRetrace = true;

            physicsSimulator = new PhysicsSimulator(new Vector2(0));
            physicsSimulator.AllowedPenetration = 0.3f;
            physicsSimulator.BiasFactor = 1.0f;
            Services.AddService(typeof(PhysicsSimulator), physicsSimulator);

            screenManager = new ScreenManager(this);
            Components.Add(screenManager);

            bloomProcessor = new BloomPostProcessor(this);
            Components.Add(bloomProcessor);

            // Uncomment this to monitor the FPS:

            //fpsCounter = new FrameRateCounter(this);
            //Components.Add(fpsCounter);

            audioEngine = new AudioEngine("Content\\Audio\\FieldPongAudio.xgs");
            waveBank = new WaveBank(audioEngine, "Content\\Audio\\Wave Bank.xwb");
            soundBank = new SoundBank(audioEngine, "Content\\Audio\\Sound Bank.xsb");

            backgroundMusic = soundBank.GetCue("GameSong0010 16 Bit");
            backgroundMusic.Play();
        }
开发者ID:zpconn,项目名称:FieldPong,代码行数:33,代码来源:FieldPong.cs

示例6: StartMainTheme

 public static void StartMainTheme()
 {
     if (mainTheme == null)
     {
         mainTheme = soundBank.GetCue("space");
         mainTheme.Play();
     }
 }
开发者ID:RayMet,项目名称:KypcoBa,代码行数:8,代码来源:AudioManager.cs

示例7: DefenderMusic

		public DefenderMusic( SoundBank sounds, AudioEngine engine ) {
			mSounds = sounds;
			mEngine = engine;
			mMusic = sounds.GetCue( "stage_music" );
			mMusicName = mMusic.Name;
			mVolume = 1.0f;
			mMusic.Play();
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:8,代码来源:DefenderMusic.cs

示例8: Tower_ZeroHealth

 void Tower_ZeroHealth(object sender, EventArgs e)
 {
     if(heartbeatCue.IsPlaying)
         heartbeatCue.Stop(AudioStopOptions.Immediate);
     audioEngine.GetCategory("Drums").Stop(AudioStopOptions.Immediate);
     outroCue = soundBank.GetCue("Outro");
     outroCue.Play();
 }
开发者ID:Daniel-Nichol,项目名称:ox-g1-surface,代码行数:8,代码来源:EffectPlayer.cs

示例9: PlayerShip

        public PlayerShip(Game game, Vector2 position)
        {
            Game = game;
            _soundBank = Game.Services.GetService<SoundBank[]>();
            _world = Game.Services.GetService<World>();
            krypton = Game.Services.GetService<KryptonEngine>();

            thrustLR = _soundBank[0].GetCue("thrust01");
            thrustLR.Play();
            thrustLR.Pause();

            thrustUD = _soundBank[0].GetCue("thrust01");
            thrustUD.Play();
            thrustUD.Pause();

            Position = position;
            _particleRenderer = Game.Services.GetService<SpriteBatchRenderer>();
            //_textures = Game.Services.GetService<Textures>();

            //Loadcontentstuff
            _shiptxture = Game.Content.Load<Texture2D>("player_ship");
            _turretTxture = Game.Content.Load<Texture2D>(".\\guns\\turret01");
            _centreVect = new Vector2(_shiptxture.Width / 2, _shiptxture.Height / 2);

            ProximityBox = new Rectangle(0, 0, _shiptxture.Width+Globals.PhysBuffer, _shiptxture.Height + Globals.PhysBuffer);

            //make ship fixture in for farseer
            box = BodyFactory.CreateCircle(_world, ConvertUnits.ToSimUnits(_shiptxture.Width / 2), 7.0f);
            box.BodyType = BodyType.Dynamic;
            box.Restitution = 0.5f;
            box.Friction = 0.2f;
            box.FixedRotation = true;
            box.LinearDamping = 0.4f;
            box.Position = ConvertUnits.ToSimUnits(Position.X + _centreVect.X, Position.Y + _centreVect.Y);
            box.UserData = "player";

            //box.OnCollision += Collide;
            box.OnSeparation += Collide;

            //make light in krypton
            var mLightTexture = LightTextureBuilder.CreateConicLight(Game.GraphicsDevice, 256, 2.0f);
            light = CreateLights(mLightTexture,400);
            var mLightTexture2 = LightTextureBuilder.CreatePointLight(Game.GraphicsDevice, 64);
            light2 = CreateLights(mLightTexture2,200);

            //set up thruster particle
            _thrustparticle = Game.Content.Load<ParticleEffect>(".\\mercury\\thruster");
            _thrustparticle.LoadContent(Game.Content);
            _thrusterEmitter = (ConeEmitter)_thrustparticle[0];
            //_thrusterEmitter.Initialise();
            _thrusterEmitter.ParticleTexture = Game.Content.Load<Texture2D>(".\\mercury\\Particle004");
            _thrustparticle.Initialise();
            _particleRenderer.LoadContent(Game.Content);

            //_centerVect = new Vector2(_shiptxture.Width / 2,_shiptxture.Width / 2);
            currentWeapon = new Gun(Game, true, BulletsStats.Plasma01);
        }
开发者ID:Wonko-the-sane,项目名称:Artefact001,代码行数:57,代码来源:PlayerShip.cs

示例10: Music

 public Music(SoundBank sounds, AudioEngine engine)
 {
     this.sounds = sounds;
     this.engine = engine;
     music = sounds.GetCue("stage_music");
     musicName = music.Name;
     volume = 1.0f;
     music.Play();
 }
开发者ID:kinaesthesia,项目名称:KDefTower,代码行数:9,代码来源:Music.cs

示例11: LoadContent

        internal void LoadContent()
        {
            //Loads the audioengine, wavebank and soundbank
            engine = new AudioEngine(@"Content/Audio/GameAudio.xgs");
            sound = new SoundBank(engine, @"Content/Audio/Sound Bank.xsb");
            wave = new WaveBank(engine, @"Content/Audio/Wave Bank.xwb");

            trackCue = sound.GetCue(songTitle);
            trackCue.Play();
        }
开发者ID:midlas10,项目名称:XNA_mappe3_Bouncing,代码行数:10,代码来源:AudioManager.cs

示例12: Update

		public void Update() {
			if( mMusic.IsStopped ) {
				mMusic = mSounds.GetCue( "stage_music" );
				mMusic.Play();
			}


			if( mBossEvent && mBossMusic.IsStopped ) {
				mBossEvent = false;
			}
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:11,代码来源:DefenderMusic.cs

示例13: Activate

 public override void Activate(bool instancePreserved)
 {
     if (!instancePreserved)
     {
         if (bgm == null)
         {
             bgm = ((GameMain)ScreenManager.Game).AudioEM.GetCue("menuBg1");
             bgm.Play();
         }
     }
 }
开发者ID:rossmas,项目名称:zomination,代码行数:11,代码来源:MainMenuScreen.cs

示例14: Initialize

        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        public override void Initialize()
        {
            //set gameplay mode
            theGame.versus = true;

            //start playing background music
            backgroundMusic = theGame.GameSoundBank.GetCue("H-Pizzle - Danger Zone (Kenny Loggins)");
            if (theGame.soundOn)
                backgroundMusic.Play();

            base.Initialize();
        }
开发者ID:GennrichJ,项目名称:PuzzleAttack,代码行数:16,代码来源:VersusMode.cs

示例15: PlayMusic

 public void PlayMusic(string musicName)
 {
     if (string.IsNullOrEmpty(musicName))
     {
         musicName = "m_Silence";
     }
     if (musicName != _currentMusic.Name)
     {
         _currentMusic = _soundBank.GetCue(musicName);
         _currentMusic.Play();
     }
 }
开发者ID:kavengagne,项目名称:TetrisGame,代码行数:12,代码来源:SoundManager.cs


注:本文中的Microsoft.Xna.Framework.Audio.Cue.Play方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。