• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Audio.Cue类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Cue类属于Microsoft.Xna.Framework.Audio命名空间,在下文中一共展示了Cue类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: PlayBuzzer

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


示例2: CoopLobbyScreen

        /// <summary>
        /// Constructor.
        /// </summary>
        public CoopLobbyScreen(Cue bgm)
            : base("Splitscreen Lobby")
        {
            this.bgm = bgm;

            // Create our menu entries.
            player1MenuEntry = new MenuEntry(string.Empty);
            player2MenuEntry = new MenuEntry(string.Empty);
            start = new MenuEntry("Start Game");

            SetMenuEntryText();

            MenuEntry back = new MenuEntry("Back");

            // Hook up menu event handlers.
            player1MenuEntry.Selected += Player1MenuEntrySelected;
            player2MenuEntry.Selected += Player2MenuEntrySelected;
            start.Selected += StartMenuEntrySelected;
            back.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(player1MenuEntry);
            MenuEntries.Add(player2MenuEntry);
            MenuEntries.Add(back);
        }
开发者ID:rossmas,项目名称:zomination,代码行数:28,代码来源:CoopLobbyScreen.cs


示例3: PlayMusic

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

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


示例4: Beam

 public Beam(Vector2 srcCenter, int Thickness, Ship Owner, GameplayObject target)
 {
     this.Target = target;
     this.owner = Owner;
     Vector2 TargetPosition = Vector2.Normalize(target.Center);
     if (Owner.InFrustum)
     {
         this.DamageToggleSound = AudioManager.GetCue("sd_shield_static_1");
     }
     if (this.owner.isInDeepSpace || this.owner.GetSystem() == null)
     {
         UniverseScreen.DeepSpaceManager.BeamList.Add(this);
     }
     else
     {
         this.system = this.owner.GetSystem();
         this.system.spatialManager.BeamList.Add(this);
     }
     this.Source = srcCenter;
     this.BeamOffsetAngle = Owner.Rotation - MathHelper.ToRadians(HelperFunctions.findAngleToTarget(srcCenter, TargetPosition));
     this.Destination = HelperFunctions.findPointFromAngleAndDistanceUsingRadians(srcCenter, Owner.Rotation + this.BeamOffsetAngle, this.range);
     this.ActualHitDestination = this.Destination;
     this.Vertices = new VertexPositionNormalTexture[4];
     this.Indexes = new int[6];
     this.BeamZ = RandomMath2.RandomBetween(-1f, 1f);
     Vector3[] points = HelperFunctions.BeamPoints(srcCenter, TargetPosition, (float)Thickness, new Vector2[4], 0, this.BeamZ);
     this.UpperLeft = points[0];
     this.UpperRight = points[1];
     this.LowerLeft = points[2];
     this.LowerRight = points[3];
     this.FillVertices();
 }
开发者ID:castroev,项目名称:StardriveBlackBox-verRadicalElements-,代码行数:32,代码来源:Beam.cs


示例5: PlayDefendSound

        public void PlayDefendSound(Unit selected)
        {
            if (selected is Soldier && selected.isPlayerUnit)
            {
                cue = soundBank.GetCue("SoldierDefend");
            }
            else if (selected is Soldier && !selected.isPlayerUnit)
            {
                cue = soundBank.GetCue("ESoldierDefend");
            }
            else if (selected is Ranger && selected.isPlayerUnit)
            {
                cue = soundBank.GetCue("RangerDefend");
            }
            else if (selected is Ranger && !selected.isPlayerUnit)
            {
                cue = soundBank.GetCue("ERangerDefend");
            }
            else if (selected is Defender && selected.isPlayerUnit)
            {
                cue = soundBank.GetCue("DefenderDefend");
            }
            else
            {
                cue = soundBank.GetCue("EDefenderDefend");
            }

            cue.Play();
        }
开发者ID:RandyRhombus,项目名称:Titans1,代码行数:29,代码来源:AudioManager.cs


示例6: 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


示例7: HandleInput

 public override void HandleInput(InputState input)
 {
     if (input.MenuUp)
     {
         this.beep = AudioManager.GetCue("blip_click");
         this.beep.Play();
         MenuScreen menuScreen = this;
         menuScreen.selectedEntry = menuScreen.selectedEntry - 1;
         if (this.selectedEntry < 0)
         {
             this.selectedEntry = this.menuEntries.Count - 1;
         }
     }
     if (input.MenuDown)
     {
         this.beep = AudioManager.GetCue("blip_click");
         this.beep.Play();
         MenuScreen menuScreen1 = this;
         menuScreen1.selectedEntry = menuScreen1.selectedEntry + 1;
         if (this.selectedEntry >= this.menuEntries.Count)
         {
             this.selectedEntry = 0;
         }
     }
     if (input.MenuSelect)
     {
         this.OnSelectEntry(this.selectedEntry);
         return;
     }
     if (input.MenuCancel)
     {
         this.OnCancel();
     }
 }
开发者ID:castroev,项目名称:StardriveBlackBox-verRadicalElements-,代码行数:34,代码来源:MenuScreen.cs


示例8: 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


示例9: Apply3DPosition

 public void Apply3DPosition(Cue cue, AudioListener listener, AudioEmitter emitter,
     Vector3 listenerPosition, Vector3 emitterPosition)
 {
     listenerPosition = listener.Position;
     emitterPosition = emitter.Position;
     cue.Apply3D(listener, emitter);
 }
开发者ID:bradleat,项目名称:trafps,代码行数:7,代码来源:Audio.cs


示例10: playLoop

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


示例11: PlayerEngineSound

        public PlayerEngineSound()
        {
            AEM = AudioEngineManager.GetInstance();
            previousVelocity = 0;

            currentSound = AEM.soundBank.GetCue("subengine");
        }
开发者ID:MintL,项目名称:datx02-rally,代码行数:7,代码来源:PlayerEngineSound.cs


示例12: PlayAttackSound

        public void PlayAttackSound(Unit attacker)
        {
            if (attacker is Soldier && attacker.isPlayerUnit)
            {
                cue = soundBank.GetCue("SoldierAttack");
            }
            else if (attacker is Soldier && !attacker.isPlayerUnit)
            {
                cue = soundBank.GetCue("ESoldierAttack");
            }
            else if (attacker is Ranger && attacker.isPlayerUnit)
            {
                cue = soundBank.GetCue("RangerAttack");
            }
            else if (attacker is Ranger && !attacker.isPlayerUnit)
            {
                cue = soundBank.GetCue("ERangerAttack");
            }
            else if (attacker is Defender && attacker.isPlayerUnit)
            {
                cue = soundBank.GetCue("DefenderAttack");
            }
            else
            {
                cue = soundBank.GetCue("EDefenderAttack");
            }

            cue.Play();
        }
开发者ID:RandyRhombus,项目名称:Titans1,代码行数:29,代码来源:AudioManager.cs


示例13: Audio

 public Audio(string clip, string settings, string waveBank, string soundBank, Game game)
     : base(game)
 {
     this.audioEngine = new AudioEngine(this.Game.Content.RootDirectory + @"\" + settings);
     this.waveBank = new WaveBank(this.audioEngine, this.Game.Content.RootDirectory + @"\" + waveBank);
     this.soundBank = new SoundBank(this.audioEngine, this.Game.Content.RootDirectory + @"\" + soundBank);
     this.sound = this.soundBank.GetCue(clip);
 }
开发者ID:Bosence,项目名称:Mr-Explosions,代码行数:8,代码来源:Audio.cs


示例14: 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


示例15: StartMainTheme

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


示例16: Create

 public static Sound1D Create(string name, Cue cue, Action<string> onFinished)
 {
     Sound1D freshSound = Pool.Acquire<Sound1D>();
     freshSound.Name = name;
     freshSound._cue = cue;
     freshSound.OnFinished = onFinished;
     return freshSound;
 }
开发者ID:Raidenthequick,项目名称:delta,代码行数:8,代码来源:Sound1D.cs


示例17: 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


示例18: CueEmitter

        public CueEmitter(Cue sound, Vector3 position)
        {
            cue = sound;

            audioEmitter = new AudioEmitter();
            audioEmitter.Position = position;
            audioEmitter.Velocity = Vector3.Zero;
        }
开发者ID:MintL,项目名称:datx02-rally,代码行数:8,代码来源:EnvironmentSoundManager.cs


示例19: 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


示例20: Apply3DAll

 public void Apply3DAll(Cue cue, AudioListener listener, AudioEmitter emitter, Vector3 listenerPosition,
     Vector3 emitterPosition, Vector3 listenerVelocity, Vector3 emitterVelocity)
 {
     listenerPosition = listener.Position;
     emitterPosition = emitter.Position;
     listener.Velocity = listener.Velocity;
     emitter.Velocity = emitter.Velocity;
     cue.Apply3D(listener, emitter);
 }
开发者ID:bradleat,项目名称:trafps,代码行数:9,代码来源:Audio.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Audio.Microphone类代码示例发布时间:2022-05-26
下一篇:
C# Audio.AudioListener类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap