예제 #1
0
        /*
         * Returns true if a relevant keyboard or joystick key was released since the last appropriate update.
         */
        public bool JustUp(string button)
        {
            BufferedButton bufferedButton = m_nameToButton[button];
            bool           isFixed        = (Time.deltaTime == Time.fixedDeltaTime);

            return(!(m_isMuted && bufferedButton.CanBeMuted) && (isFixed ? m_firstFixedFrame && bufferedButton.JustUp() : bufferedButton.VisualJustUp()));
        }
예제 #2
0
        public void AddButton(string name, string displayName, bool canRebind, bool canBeMuted, params ISource <bool>[] defaultBindings)
        {
            BufferedButton button = new BufferedButton(displayName, canRebind, canBeMuted, defaultBindings);

            m_buttons.Add(button);
            m_nameToButton.Add(name, button);
        }
예제 #3
0
        public void AddBinding(IInputSource source, Action onRebindComplete)
        {
            if (m_rebindState == RebindState.None)
            {
                if (source is BufferedButton)
                {
                    m_rebindState     = RebindState.Button;
                    m_rebindingButton = (BufferedButton)source;
                }
                else if (source is BufferedAxis)
                {
                    m_rebindState   = RebindState.Axis;
                    m_rebindingAxis = (BufferedAxis)source;
                }

                m_onRebindComplete         = onRebindComplete;
                m_rebindingPreviousKeys    = FindActiveKeys(false);
                m_rebindingPreviousButtons = FindActiveButtons(false);
            }
        }
예제 #4
0
        /*
         * Returns true if any of the relevant keyboard or joystick buttons are held down.
         */
        public bool IsDown(string button)
        {
            BufferedButton bufferedButton = m_nameToButton[button];

            return(!(m_isMuted && bufferedButton.CanBeMuted) && bufferedButton.IsDown());
        }