本文整理汇总了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);
}
示例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);
}
示例3: PlayMusic
public static void PlayMusic(string name)
{
StopMusic();
cue = soundBank.GetCue(name);
cue.Play();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
}
示例8: TriggerBossEvent
public void TriggerBossEvent() {
mBossEvent = true;
mMusic.Pause();
mBossMusic = mSounds.GetCue( "boss_music" );
mMusicName = mBossMusic.Name;
mBossMusic.Play();
}
示例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);
}
示例10: playLoop
static void playLoop(ref Cue cue) {
if (!cue.IsPlaying) {
StopLoops();
InitCues();
cue.Play();
}
}
示例11: PlayerEngineSound
public PlayerEngineSound()
{
AEM = AudioEngineManager.GetInstance();
previousVelocity = 0;
currentSound = AEM.soundBank.GetCue("subengine");
}
示例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();
}
示例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);
}
示例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();
}
示例15: StartMainTheme
public static void StartMainTheme()
{
if (mainTheme == null)
{
mainTheme = soundBank.GetCue("space");
mainTheme.Play();
}
}