void Init() { //Debug.Log("Loading Default controls"); /*Sinput.LoadControlScheme("MainControlScheme", false); * controlsDefaults = Sinput.controls; * * //Debug.Log("loading controls with saved data"); * Sinput.LoadControlScheme("MainControlScheme", true); * controls = Sinput.controls;*/ Sinput.LoadControlScheme("MainControlScheme", false); Control[] sinputControls = Sinput.controls; controlsDefaults = new Control[sinputControls.Length]; for (int i = 0; i < sinputControls.Length; i++) { controlsDefaults[i] = new Control(sinputControls[i].name); for (int k = 0; k < sinputControls[i].commonMappings.Count; k++) { controlsDefaults[i].commonMappings.Add(sinputControls[i].commonMappings[k]); } controlsDefaults[i].inputs = new List <DeviceInput>(); for (int k = 0; k < sinputControls[i].inputs.Count; k++) { controlsDefaults[i].inputs.Add(sinputControls[i].inputs[k]); } } //Debug.Log("loading controls with saved data"); Sinput.LoadControlScheme("MainControlScheme", true); sinputControls = Sinput.controls; controls = new Control[sinputControls.Length]; for (int i = 0; i < sinputControls.Length; i++) { controls[i] = new Control(sinputControls[i].name); for (int k = 0; k < sinputControls[i].commonMappings.Count; k++) { controls[i].commonMappings.Add(sinputControls[i].commonMappings[k]); } controls[i].inputs = new List <DeviceInput>(); for (int k = 0; k < sinputControls[i].inputs.Count; k++) { controls[i].inputs.Add(sinputControls[i].inputs[k]); } } recordedPads = Sinput.gamepads; //Debug.Log("It should be over?"); BuildRebindingPanels(); }
private void InitializeMouseSensitivity() { // this is a really janky way to set the mouse sensitivity to .2f by default to balance out the controller input if (!PlayerPrefs.HasKey("OneTimeRun.MouseSensitivity")) { Sinput.LoadControlScheme("MainControlScheme", true); // need to load it before we can save it Sinput.mouseSensitivity = .2f; // initialize it once SinputSystems.SinputFileIO.SaveControls(Sinput.controls, Sinput.controlSchemeName); PlayerPrefs.SetString("OneTimeRun.MouseSensitivity", "done"); } }
void Awake() { Sinput.LoadControlScheme(controlScheme, false); }