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


C# Cue.Pause方法代码示例

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


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

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

示例2: AudioManager

        public AudioManager(Game1 game)
            : base(game)
        {
            myGame = game;
            events = new List<Event>();
            game.mediator.register(this, MyEvent.C_ATTACK_BULLET_END, MyEvent.M_BITE, MyEvent.G_GameOver);

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

            trackCue =  soundBank.GetCue("Cowboy");
            trackCue.Play();
            trackCue.Pause();
        }
开发者ID:blackEagle2012,项目名称:XNA-Game-project,代码行数:15,代码来源:AudioManager.cs

示例3: pararMusica

 private void pararMusica(Cue value)
 {
     if (value.IsPlaying)
         value.Pause();
 }
开发者ID:PepeAleu,项目名称:Klastion-final-proyect,代码行数:5,代码来源:Creditos.cs

示例4: pauseSound

 public static void pauseSound(Cue s)
 {
     PSound = s;
        PSound.Pause();
 }
开发者ID:Arsinx,项目名称:SageEngine,代码行数:5,代码来源:SoundHandler.cs

示例5: Pause

 public void Pause(Cue cue)
 {
     if (cue.IsPaused)
     {
         cue.Resume();
     }
     else if (cue.IsPlaying)
     {
         cue.Pause();
     }
     else
     {
         // If stopped, create a new cue.
         cue = soundBank.GetCue(cue.Name);
         cue.Play();
     }
 }
开发者ID:bradleat,项目名称:trafps,代码行数:17,代码来源:Audio.cs

示例6: Player

        public Player( GameplayScreen screen, int playerNumber, PlayerIndex playerIndex, Avatar avatar, Vector2 pos, uint id )
            : base(screen)
        {
            WheelModel = screen.Content.Load<CustomModel>( "Models/hamsterBall" );
              foreach ( CustomModelSample.CustomModel.ModelPart part in WheelModel.ModelParts )
              {
            part.Effect.CurrentTechnique = part.Effect.Techniques["Color"];
            part.Effect.Parameters["Color"].SetValue( new Vector4( .8f, .7f, 1f, .225f ) );
            part.Effect.Parameters["SpecularPower"].SetValue( 400 );
            part.Effect.Parameters["Mask"].SetValue( MaskHelper.MotionBlur( 1 ) );
              }

              DrawOrder = 8;

              WinState = PlayerWinState.None;

              soundPosition = Vector3.Zero;
              soundVelocity = Vector3.Zero;

              float depth = screen.Camera.Position.Z;
              DeathLine = depth * (float)Math.Tan( screen.Camera.Fov / 2f );

              RespawnTime = float.MaxValue;

              shrinkBegin = 0;
              Scale = 1f;
              ScaleSpring = new SpringInterpolater( 1, 200, SpringInterpolater.GetCriticalDamping( 200 ) );
              ScaleSpring.Active = true;
              ScaleSpring.SetSource( Scale );
              ScaleSpring.SetDest( Scale );

              PlayerIndex = playerIndex;
              PlayerNumber = playerNumber;
              BoostBurnRate = 1f;
              BoostRechargeRate = .25f;

              Avatar = avatar;
              BoundingCircle = new PhysCircle( Size / 2f, pos, 10f );
              BoundingCircle.Parent = this;
              BoundingCircle.Elasticity = .4f;
              BoundingCircle.Friction = .5f;
              BoundingCircle.Collided += HandleCollision;
              BoundingCircle.Responded += HandleCollisionResponse;
              screen.PhysicsSpace.AddBody( BoundingCircle );

              walkAnim = CustomAvatarAnimationData.GetAvatarAnimationData( "Walk", Screen.Content );
              runAnim  = CustomAvatarAnimationData.GetAvatarAnimationData( "Run", Screen.Content );

              // pre-load animations for podium screen
              avatar.SetAnimation( AvatarAnimationPreset.Celebrate );
              avatar.SetAnimation( AvatarAnimationPreset.Clap );
              avatar.SetAnimation( AvatarAnimationPreset.FemaleAngry );
              avatar.SetAnimation( AvatarAnimationPreset.MaleCry );

              standAnim = (AvatarAnimationPreset)( (int)AvatarAnimationPreset.Stand0 + random.Next( 8 ) );
              avatar.SetAnimation( standAnim );

              if ( playerIndex >= PlayerIndex.One )
              {
            HUD = new PlayerHUD( this, SignedInGamer.SignedInGamers[playerIndex] );
              }
              else
              {
            HUD = new PlayerHUD( this, null );
            playerAI = new PlayerAI( this );
              }

              vertexDeclaration = new VertexDeclaration( screen.ScreenManager.GraphicsDevice,
                                                 VertexPositionNormalTexture.VertexElements );

              boosterSound = GameCore.Instance.AudioManager.Play2DCue( "booster", 1f );
              boosterSound.Pause();

              glow = new CircularGlow( new Vector3( BoundingCircle.Position, 0 ), Color.OrangeRed, Size );
              glow.Player = this;
              screen.ObjectTable.Add( glow );

              glowSpring = new SpringInterpolater( 1, 500, .75f * SpringInterpolater.GetCriticalDamping( 500 ) );
              glowSpring.Active = true;
              glowSpring.SetSource( 0 );
              glowSpring.SetDest( 0 );

              Tag = new PlayerTag( this, screen.Content.Load<SpriteFont>( "Fonts/playerTagFont" ) );

              SetID( id );
        }
开发者ID:yxrkt,项目名称:AvatarHamsterPanic,代码行数:86,代码来源:Player.cs


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