Esempio n. 1
0
 private void OnEnable()
 {
     this.updateMode             = Remapping.UpdateMode.ButtonSelectMode;
     this.selectedControllerType = (ControllerType)2;
     this.selectedControllerId   = 0;
     this.settingOrDeleteWindow.SetActive(false);
     if (!ReInput.get_isReady())
     {
         return;
     }
     ReInput.add_ControllerConnectedEvent(new Action <ControllerStatusChangedEventArgs>(this.OnControllerChanged));
     ReInput.add_ControllerDisconnectedEvent(new Action <ControllerStatusChangedEventArgs>(this.OnControllerChanged));
     ((UnityEventBase)this.settingButton.get_onClick()).RemoveAllListeners();
     ((UnityEventBase)this.deleteButton.get_onClick()).RemoveAllListeners();
     ((UnityEventBase)this.returnButton.get_onClick()).RemoveAllListeners();
     // ISSUE: method pointer
     ((UnityEvent)this.settingButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003COnEnable\u003Em__0)));
     // ISSUE: method pointer
     ((UnityEvent)this.deleteButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003COnEnable\u003Em__1)));
     // ISSUE: method pointer
     ((UnityEvent)this.returnButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003COnEnable\u003Em__2)));
     this.SetJoystickActiv();
     this.SetControllerToDropdown();
     this.LoadControllerSetting();
     this.InitializeUI();
 }
Esempio n. 2
0
 private void Awake()
 {
     if (!ReInput.get_unityJoystickIdentificationRequired())
     {
         return;
     }
     ReInput.add_ControllerConnectedEvent(new Action <ControllerStatusChangedEventArgs>(this.JoystickConnected));
     ReInput.add_ControllerDisconnectedEvent(new Action <ControllerStatusChangedEventArgs>(this.JoystickDisconnected));
     this.IdentifyAllJoysticks();
 }
Esempio n. 3
0
 private void OnEnable()
 {
     if (!ReInput.get_isReady())
     {
         return;
     }
     this.inputMapper.get_options().set_timeout(5f);
     this.inputMapper.get_options().set_ignoreMouseXAxis(true);
     this.inputMapper.get_options().set_ignoreMouseYAxis(true);
     ReInput.add_ControllerConnectedEvent(new Action <ControllerStatusChangedEventArgs>(this.OnControllerChanged));
     ReInput.add_ControllerDisconnectedEvent(new Action <ControllerStatusChangedEventArgs>(this.OnControllerChanged));
     this.inputMapper.add_InputMappedEvent(new Action <InputMapper.InputMappedEventData>(this.OnInputMapped));
     this.inputMapper.add_StoppedEvent(new Action <InputMapper.StoppedEventData>(this.OnStopped));
     this.InitializeUI();
 }
Esempio n. 4
0
 private void Awake()
 {
     this._uiElementsArray = new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement[23]
     {
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(0, this.leftStickX),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(1, this.leftStickY),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(17, this.leftStickButton),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(2, this.rightStickX),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(3, this.rightStickY),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(18, this.rightStickButton),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(4, this.actionBottomRow1),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(5, this.actionBottomRow2),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(6, this.actionBottomRow3),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(7, this.actionTopRow1),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(8, this.actionTopRow2),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(9, this.actionTopRow3),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(14, this.center1),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(15, this.center2),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(16, this.center3),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(19, this.dPadUp),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(20, this.dPadRight),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(21, this.dPadDown),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(22, this.dPadLeft),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(10, this.leftShoulder),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(11, this.leftTrigger),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(12, this.rightShoulder),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.UIElement(13, this.rightTrigger)
     };
     for (int index = 0; index < this._uiElementsArray.Length; ++index)
     {
         this._uiElements.Add(this._uiElementsArray[index].id, this._uiElementsArray[index].element);
     }
     this._sticks = new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.Stick[2]
     {
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.Stick(this.leftStick, 0, 1),
         new Rewired.Demos.GamepadTemplateUI.GamepadTemplateUI.Stick(this.rightStick, 2, 3)
     };
     ReInput.add_ControllerConnectedEvent(new Action <ControllerStatusChangedEventArgs>(this.OnControllerConnected));
     ReInput.add_ControllerDisconnectedEvent(new Action <ControllerStatusChangedEventArgs>(this.OnControllerDisconnected));
 }