void OnDisable(){ if (isHorizontal) { InputHandler.LeftStickEvent().horizontalAnalogEvent.becameActive -= Move; InputHandler.DPadEvent ().horizontalAnalogEvent.becameActive -= Move; } else { InputHandler.LeftStickEvent().verticalAnalogEvent.becameActive -= Move; InputHandler.DPadEvent().verticalAnalogEvent.becameActive -= Move; } InputHandler.AEvent().becameActive -= Activate; }
void OnDisable() { InputHandler.LeftStickEvent().horizontalAnalogEvent.becameActive -= MoveHorizontally; InputHandler.LeftStickEvent().verticalAnalogEvent.becameActive -= MoveVertically; InputHandler.DPadEvent().horizontalAnalogEvent.becameActive -= MoveHorizontally; InputHandler.DPadEvent().verticalAnalogEvent.becameActive -= MoveVertically; InputHandler.BEvent().becameActive -= Return; InputHandler.AEvent().becameActive -= Activate; }
void OnEnable(){ UpdateButtonsEnabled (); if (isHorizontal) { InputHandler.LeftStickEvent().horizontalAnalogEvent.becameActive += Move; InputHandler.DPadEvent ().horizontalAnalogEvent.becameActive += Move; } else { InputHandler.LeftStickEvent().verticalAnalogEvent.becameActive += Move; InputHandler.DPadEvent().verticalAnalogEvent.becameActive += Move; } InputHandler.AEvent().becameActive += Activate; }
void Start() { InputHandler.StartEvent().becameActive += TriggerPauseMenu; InputHandler.LeftTriggerEvent().getValue += actions.AdjustMovementBehavior; InputHandler.LeftStickEvent().getValue += actions.Movement; InputHandler.AEvent().becameActive += Jump; InputHandler.YEvent().becameActive += CheckItemUsage; InputHandler.BEvent().becameActive += CheckForDodge; InputHandler.XEvent().becameActive += Attack; InputHandler.LBEvent().becameActive += HotbarNavigationLeft; InputHandler.RBEvent().becameActive += HotbarNavigationRight; InputHandler.RightTriggerEvent().becameActive += ChangeHotbar; }
void OnTriggerExit(Collider col) { Interactive i = col.GetComponent <Interactive> (); if (i != null) { if (i as AutomaticStructure != null) { i.OnInteract(); } interactables.Remove(col.GetComponent <Interactive> ()); if (interactables.Count == 0) { InputHandler.AEvent().becameActive -= Interact; InputHandler.AEvent().becameActive += PlayerController.instance.Jump; } } }