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


C# Audio.Cue類代碼示例

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


Cue類屬於Microsoft.Xna.Framework.Audio命名空間,在下文中一共展示了Cue類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


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