示例#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));
            }
        }
示例#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);
                }
            }
        }