private void Awake() { _lobbyToggle = lobbyToggleProvider.value; _bankingToggle = bankingToggleProvider.value; _betStepper = betStepProvider.value; _autoBetToggle = autoBetToggleProvider.value; _soundToggle = soundToggleProvider.value; }
public PlayerInput(IStateProxyInput playerStates, IPhysicsEventInput playerEvent, ICameraInput playerCamera) { _InputDeviceLayout = new InputDeviceLayout(); #region Initialize Input Functionality //Toggle inputs _EventSprint = new Input_SprintEvent(playerStates.ProxySprint()); _EventCrouch = new Input_CrouchEvent(playerStates.ProxyCrouch()); //Analog stick inputs _EventWalk = new Input_WalkeEvent(playerStates.ProxyWalk()); _EventLook = new Input_LookEvent(playerCamera.ProxyLook()); //Button release inputs _EventJump = new Input_JumpEvent(playerStates.ProxyJump()); #endregion #region Set Up Observers _EventWalk.GetObservable().AddObserver(playerStates.ProxySprintObserver()); _EventWalk.GetObservable().AddObserver(playerEvent.PhysicsPlayer()); _EventLook.GetObservable().AddObserver(playerCamera); #endregion #region Input Device Callback Functions //Analog inputs callback functions _InputDeviceLayout.Player.Walk.started += ctx => _EventWalk.AnalogStart(ctx.ReadValue <Vector2>()); _InputDeviceLayout.Player.Walk.performed += ctx => _EventWalk.AnalogPerform(ctx.ReadValue <Vector2>()); _InputDeviceLayout.Player.Walk.canceled += ctx => _EventWalk.AnalogCancel(); _InputDeviceLayout.Player.Look.started += ctx => _EventLook.AnalogStart(ctx.ReadValue <Vector2>()); _InputDeviceLayout.Player.Look.performed += ctx => _EventLook.AnalogPerform(ctx.ReadValue <Vector2>()); _InputDeviceLayout.Player.Look.canceled += ctx => _EventLook.AnalogCancel(); //Button release inputs callback functions _InputDeviceLayout.Player.Jump.started += ctx => _EventJump.ButtonStart(); //Button hold inputs callback functions //Toogle inputs callback functions _InputDeviceLayout.Player.Sprint.started += ctx => _EventSprint.TogglePressed(); _InputDeviceLayout.Player.Crouch.started += ctx => _EventCrouch.TogglePressed(); #endregion }
public void SetInput(IToggleInput input) { _CrouchInput = input; }
public void SetInput(IToggleInput input) { _SprintToggle = input; }
private bool isToggleActive(IToggleInput control) { return(control.isVisible && control.isEnabled && control.isActive); }