Beispiel #1
0
        public void AddAxis(string name, string displayName, bool canRebind, bool canBeMuted, float exponent, params ISource <float>[] defaultBindings)
        {
            BufferedAxis axis = new BufferedAxis(displayName, canRebind, canBeMuted, exponent, defaultBindings);

            m_axes.Add(axis);
            m_nameToAxis.Add(name, axis);
        }
Beispiel #2
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);
            }
        }
Beispiel #3
0
        /*
         * Returns the cumulative value of an axis from all Update frames since the last FixedUpdate.
         */
        public float CumulativeValue(string axis)
        {
            BufferedAxis bufferedAxis = m_nameToAxis[axis];

            return((m_isMuted && bufferedAxis.CanBeMuted) ? 0 : bufferedAxis.GetValue(false));
        }
Beispiel #4
0
        /*
         * Returns the average value of an axis from all Update frames since the last FixedUpdate.
         */
        public float AverageValue(string axis)
        {
            BufferedAxis bufferedAxis = m_nameToAxis[axis];

            return((m_isMuted && bufferedAxis.CanBeMuted) ? 0 : bufferedAxis.GetValue(true));
        }