示例#1
0
        public override void Update(GameTime gameTime)
        {
            bool doUpdate = true;

            switch (this.State)
            {
            case eScreenState.Activating:
            case eScreenState.Deactivating:
            case eScreenState.Closing:
                UpdateTransition(gameTime);
                break;

            case eScreenState.Active:
                break;

            case eScreenState.Inactive:
            case eScreenState.Closed:
                doUpdate = false;
                break;

            default:
                break;
            }

            if (doUpdate)
            {
                base.Update(gameTime);

                ISoundSettings gameSettings = (this.Game.Services.GetService(typeof(IGameSettings)) as ISoundSettings);
                if (gameSettings != null)
                {
                    if (InputManager.KeyPressed(Keys.M))
                    {
                        gameSettings.SetIsMuted(!gameSettings.IsMuted());
                    }
                }

                if (PreviousScreen != null && !this.IsModal)
                {
                    PreviousScreen.Update(gameTime);
                }

                foreach (KeyValuePair <Keys, NamedAction> keyAndAction in m_ActivationKeys)
                {
                    if (InputManager.KeyPressed(keyAndAction.Key))
                    {
                        keyAndAction.Value.Action.Invoke();
                    }
                }
            }
        }
示例#2
0
 private void mute(bool i_Mute)
 {
     m_SoundSettings.SetIsMuted(true);
 }