// ---------------- static private string GetUniqueControlName(InputRig rig, System.Type controlType, string prefix) { if (rig == null) { return(""); } List <TouchControl> controls = rig.GetTouchControls(); for (int ci = 0; ci < 100; ++ci) { string nameToTest = prefix + ci.ToString(); for (int i = 0; i < controls.Count; ++i) { TouchControl c = controls[i]; if ((c.GetType() == controlType) && (c.name == nameToTest)) { nameToTest = null; break; } } if (nameToTest != null) { return(nameToTest); } } return(prefix + controls.Count.ToString()); }
//public string joyName; // --------------------- static public void AddControlListBindingsToMenu( GenericMenu menu, List <TouchControl> controlList, System.Action onRefreshCallback, BindingDescription.BindingType typeMask, string commandName, string menuPath, KeyCode digiKey = KeyCode.None, string axisName = null) //bool digiBindToPositiveAxis = true) //string joyName = null) { for (int i = 0; i < controlList.Count; ++i) { TouchControl c = controlList[i]; AddBindingContainerToMenu(menu, c, onRefreshCallback, typeMask, commandName, (menuPath + c.name + " (" + c.GetType().Name + ")/"), c, digiKey, axisName); } }