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)); } }
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); } } }