Ejemplo 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();
 }
Ejemplo n.º 2
0
 private void Update()
 {
     if (!ReInput.get_isReady() || this.initialized)
     {
         return;
     }
     this.Initialize();
 }
Ejemplo n.º 3
0
 private void Update()
 {
     if (!ReInput.get_isReady())
     {
         return;
     }
     this.AssignJoysticksToPlayers();
 }
Ejemplo n.º 4
0
 private void Update()
 {
     if (!ReInput.get_isReady())
     {
         return;
     }
     this.DrawActiveElements();
 }
Ejemplo n.º 5
0
 private void Start()
 {
     if (!ReInput.get_isReady())
     {
         return;
     }
     this.DrawLabels();
 }
Ejemplo n.º 6
0
 private void Update()
 {
     if (!ReInput.get_isReady() || this.player == null)
     {
         return;
     }
     this.GetInput();
     this.ProcessInput();
 }
 private void Update()
 {
     if (!ReInput.get_isReady())
     {
         return;
     }
     if (!this.initialized)
     {
         this.Initialize();
     }
     this.GetInput();
     this.ProcessInput();
 }
Ejemplo n.º 8
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();
 }
Ejemplo n.º 9
0
        private void Update()
        {
            if (!ReInput.get_isReady())
            {
                return;
            }
            IDualShock4Extension firstDs4 = this.GetFirstDS4(this.player);

            if (firstDs4 != null)
            {
                ((Component)this).get_transform().set_rotation(firstDs4.GetOrientation());
                this.HandleTouchpad(firstDs4);
                this.accelerometerTransform.LookAt(Vector3.op_Addition(this.accelerometerTransform.get_position(), firstDs4.GetAccelerometerValue()));
            }
            if (this.player.GetButtonDown("CycleLight"))
            {
                this.SetRandomLightColor();
            }
            if (this.player.GetButtonDown("ResetOrientation"))
            {
                this.ResetOrientation();
            }
            if (this.player.GetButtonDown("ToggleLightFlash"))
            {
                if (this.isFlashing)
                {
                    this.StopLightFlash();
                }
                else
                {
                    this.StartLightFlash();
                }
                this.isFlashing = !this.isFlashing;
            }
            if (this.player.GetButtonDown("VibrateLeft"))
            {
                ((IControllerVibrator)firstDs4).SetVibration(0, 1f, 1f);
            }
            if (!this.player.GetButtonDown("VibrateRight"))
            {
                return;
            }
            ((IControllerVibrator)firstDs4).SetVibration(1, 1f, 1f);
        }
Ejemplo n.º 10
0
        private void OnDisable()
        {
            if (!ReInput.get_isReady())
            {
                return;
            }
            Player player = ReInput.get_players().GetPlayer(0);

            if (player == null)
            {
                return;
            }
            player.RemoveInputEventDelegate(new Action <InputActionEventData>(this.OnMoveReceivedX));
            player.RemoveInputEventDelegate(new Action <InputActionEventData>(this.OnMoveReceivedY));
            player.RemoveInputEventDelegate(new Action <InputActionEventData>(this.OnCycleColor));
            player.RemoveInputEventDelegate(new Action <InputActionEventData>(this.OnCycleColorReverse));
            player.RemoveInputEventDelegate(new Action <InputActionEventData>(this.OnRotationReceivedX));
            player.RemoveInputEventDelegate(new Action <InputActionEventData>(this.OnRotationReceivedY));
        }
 public static Player GetRewiredPlayer(int gamePlayerId)
 {
     if (!ReInput.get_isReady())
     {
         return((Player)null);
     }
     if (Object.op_Equality((Object)PressStartToJoinExample_Assigner.instance, (Object)null))
     {
         Debug.LogError((object)"Not initialized. Do you have a PressStartToJoinPlayerSelector in your scehe?");
         return((Player)null);
     }
     for (int index = 0; index < PressStartToJoinExample_Assigner.instance.playerMap.Count; ++index)
     {
         if (PressStartToJoinExample_Assigner.instance.playerMap[index].gamePlayerId == gamePlayerId)
         {
             return(ReInput.get_players().GetPlayer(PressStartToJoinExample_Assigner.instance.playerMap[index].rewiredPlayerId));
         }
     }
     return((Player)null);
 }
 private void Update()
 {
     if (!ReInput.get_isReady())
     {
         return;
     }
     this.pointer.get_transform().Rotate(Vector3.get_forward(), ((PlayerController.Axis) this.mouse.get_wheel().get_yAxis()).get_value() * 20f);
     if (this.mouse.get_leftButton().get_justPressed())
     {
         this.CreateClickEffect(new Color(0.0f, 1f, 0.0f, 1f));
     }
     if (this.mouse.get_rightButton().get_justPressed())
     {
         this.CreateClickEffect(new Color(1f, 0.0f, 0.0f, 1f));
     }
     if (!this.mouse.get_middleButton().get_justPressed())
     {
         return;
     }
     this.CreateClickEffect(new Color(1f, 1f, 0.0f, 1f));
 }
Ejemplo n.º 13
0
        private void OnEnable()
        {
            if (!ReInput.get_isReady())
            {
                return;
            }
            Player player = ReInput.get_players().GetPlayer(0);

            if (player == null)
            {
                return;
            }
            player.AddInputEventDelegate(new Action <InputActionEventData>(this.OnMoveReceivedX), (UpdateLoopType)0, (InputActionEventType)33, "Horizontal");
            player.AddInputEventDelegate(new Action <InputActionEventData>(this.OnMoveReceivedX), (UpdateLoopType)0, (InputActionEventType)34, "Horizontal");
            player.AddInputEventDelegate(new Action <InputActionEventData>(this.OnMoveReceivedY), (UpdateLoopType)0, (InputActionEventType)33, "Vertical");
            player.AddInputEventDelegate(new Action <InputActionEventData>(this.OnMoveReceivedY), (UpdateLoopType)0, (InputActionEventType)34, "Vertical");
            player.AddInputEventDelegate(new Action <InputActionEventData>(this.OnCycleColor), (UpdateLoopType)0, (InputActionEventType)3, "CycleColor");
            player.AddInputEventDelegate(new Action <InputActionEventData>(this.OnCycleColorReverse), (UpdateLoopType)0, (InputActionEventType)3, "CycleColorReverse");
            player.AddInputEventDelegate(new Action <InputActionEventData>(this.OnRotationReceivedX), (UpdateLoopType)0, (InputActionEventType)33, "RotateHorizontal");
            player.AddInputEventDelegate(new Action <InputActionEventData>(this.OnRotationReceivedX), (UpdateLoopType)0, (InputActionEventType)34, "RotateHorizontal");
            player.AddInputEventDelegate(new Action <InputActionEventData>(this.OnRotationReceivedY), (UpdateLoopType)0, (InputActionEventType)33, "RotateVertical");
            player.AddInputEventDelegate(new Action <InputActionEventData>(this.OnRotationReceivedY), (UpdateLoopType)0, (InputActionEventType)34, "RotateVertical");
        }
        private void Update()
        {
            if (!ReInput.get_isReady())
            {
                return;
            }
            Vector2 vector2;

            ((Vector2) ref vector2).\u002Ector(this.player.GetAxis("Move Horizontal"), this.player.GetAxis("Move Vertical"));
            this.cc.Move(Vector2.op_Implicit(Vector2.op_Multiply(Vector2.op_Multiply(vector2, this.speed), Time.get_deltaTime())));
            if (this.player.GetButtonDown("Fire"))
            {
                ((Rigidbody)((GameObject)Object.Instantiate <GameObject>((M0)this.bulletPrefab, Vector3.op_Addition(((Component)this).get_transform().get_position(), Vector3.Scale(new Vector3(1f, 0.0f, 0.0f), ((Component)this).get_transform().get_right())), Quaternion.get_identity())).GetComponent <Rigidbody>()).set_velocity(new Vector3(this.bulletSpeed * (float)((Component)this).get_transform().get_right().x, 0.0f, 0.0f));
            }
            if (!this.player.GetButtonDown("Change Color"))
            {
                return;
            }
            Renderer component = (Renderer)((Component)this).GetComponent <Renderer>();
            Material material  = component.get_material();

            material.set_color(new Color(Random.Range(0.0f, 1f), Random.Range(0.0f, 1f), Random.Range(0.0f, 1f), 1f));
            component.set_material(material);
        }