public void Load(BinaryReader _reader) { try { int num1 = _reader.ReadInt32(); for (int index1 = 0; index1 < num1; ++index1) { string _controllerName = _reader.ReadString(); ControllerType _controllerType = (ControllerType)_reader.ReadInt32(); int num2 = _reader.ReadInt32(); this.DeleteControllerSetting(_controllerType, _controllerName); ControllerSetting controllerSetting = new ControllerSetting(_controllerName, _controllerType); for (int index2 = 0; index2 < num2; ++index2) { InputSetting _inputSetting = new InputSetting(_reader.ReadInt32(), _reader.ReadInt32(), (ControllerType)_reader.ReadInt32(), (ControllerElementType)_reader.ReadInt32(), _reader.ReadInt32(), (AxisRange)_reader.ReadInt32(), (KeyCode)_reader.ReadInt32(), (ModifierKeyFlags)_reader.ReadInt32(), _reader.ReadInt32(), (Pole)_reader.ReadInt32(), _reader.ReadBoolean(), _reader.ReadInt32()); controllerSetting.AddElement(_inputSetting); } this.controllerList.Add(controllerSetting); } Debug.Log((object)"ロードに成功しました:Load(BinaryReader _reader)"); } catch (Exception ex) { Debug.LogException(ex); } }
private void ControllerMappingToSetting(ControllerType _controllerType) { List <ControllerSetting> controllerSettingList = new List <ControllerSetting>(); switch ((int)_controllerType) { case 0: case 1: this.DeleteControllerSetting(_controllerType, (string)null); ControllerSetting controllerSetting1 = new ControllerSetting(_controllerType, 0); if (_controllerType == null) { controllerSettingList.Add(controllerSetting1); break; } break; case 2: for (int index = 0; index < this.joystickCount; ++index) { ControllerSetting controllerSetting2 = new ControllerSetting(_controllerType, (int)((Controller)this.joysticks[index]).id); this.DeleteControllerSetting(_controllerType, controllerSetting2.controllerName); controllerSettingList.Add(controllerSetting2); } break; } foreach (ControllerSetting controllerSetting2 in controllerSettingList) { if (controllerSetting2.maps != null) { this.controllerList.Add(controllerSetting2); using (IEnumerator <ControllerMap> enumerator1 = ((IEnumerable <ControllerMap>)controllerSetting2.maps).GetEnumerator()) { while (((IEnumerator)enumerator1).MoveNext()) { using (IEnumerator <ActionElementMap> enumerator2 = ((IEnumerable <ActionElementMap>)enumerator1.Current.get_AllMaps()).GetEnumerator()) { while (((IEnumerator)enumerator2).MoveNext()) { ActionElementMap current = enumerator2.Current; controllerSetting2.AddElement(new InputSetting(current)); } } } } } } controllerSettingList.Clear(); }