Exemplo n.º 1
0
        public void LatchFromSourceButtons(Bk2ControllerAdapter latching, IController source)
        {
            foreach (string button in source.Type.BoolButtons)
            {
                latching[button] = source.IsPressed(button);
            }

            foreach (string name in source.Type.FloatControls)
            {
                latching.SetFloat(name, source.GetFloat(name));
            }
        }
Exemplo n.º 2
0
        private void ORLatchFromSource(Bk2ControllerAdapter latching, IController source)
        {
            foreach (string button in latching.Type.BoolButtons)
            {
                latching[button] |= source.IsPressed(button);
            }

            foreach (string name in latching.Type.FloatControls)
            {
                float sFloat     = source.GetFloat(name);
                int   indexRange = source.Type.FloatControls.IndexOf(name);
                if (sFloat == source.Type.FloatRanges[indexRange].Mid)
                {
                    latching.SetFloat(name, sFloat);
                }
            }
        }