protected override void Awake() { base.Awake(); AnimationControl = CharacterBodyParts.AnimationControl; CamControl = CharacterBodyParts.FirstPersonCameraControl; PlayerInputs = new WorldTriggerInputs(); PlayerInputs.Enable(); PlayerInputs.Player.Move.performed += ctx => OnMove(ctx); PlayerInputs.Player.Look.performed += ctx => OnLook(ctx); PlayerInputs.Player.Melee.performed += ctx => OnMelee(ctx); PlayerInputs.Player.Jump.performed += ctx => OnJump(ctx); PlayerInputs.Player.LeanLeft.performed += ctx => OnLeanLeft(ctx); PlayerInputs.Player.LeanRight.performed += ctx => OnLeanRight(ctx); PlayerInputs.Player.Attach.performed += ctx => OnAttach(ctx); PlayerInputs.Player.Prone.performed += ctx => OnProne(ctx); PlayerInputs.Player.Crouch.performed += ctx => OnCrouch(ctx); PlayerInputs.Player.SwapToMainTriggerSlot1.performed += ctx => OnSwapToMainTriggerSlot1(ctx); PlayerInputs.Player.SwapToMainTriggerSlot2.performed += ctx => OnSwapToMainTriggerSlot2(ctx); PlayerInputs.Player.SwapToMainTriggerSlot3.performed += ctx => OnSwapToMainTriggerSlot3(ctx); PlayerInputs.Player.SwapToMainTriggerSlot4.performed += ctx => OnSwapToMainTriggerSlot4(ctx); PlayerInputs.Player.SwaptoSubTrigger1.performed += ctx => OnSwaptoSubTrigger1(ctx); PlayerInputs.Player.SwaptoSubTrigger2.performed += ctx => OnSwaptoSubTrigger2(ctx); PlayerInputs.Player.SwaptoSubTrigger3.performed += ctx => OnSwaptoSubTrigger3(ctx); PlayerInputs.Player.SwaptoSubTrigger4.performed += ctx => OnSwaptoSubTrigger4(ctx); PlayerInputs.Player.ToggleSwapRightMainTrigger.performed += ctx => OnToggleSwapRightMainTrigger(ctx); PlayerInputs.Player.ToggleSwapLeftMainTrigger.performed += ctx => OnToggleSwapLeftMainTrigger(ctx); PlayerInputs.Player.ToggleSwapRightSubTrigger.performed += ctx => OnToggleSwapRightSubTrigger(ctx); PlayerInputs.Player.ToggleSwapLeftSubTrigger.performed += ctx => OnToggleSwapLeftSubTrigger(ctx); PlayerInputs.Player.Info.performed += ctx => OnInfo(ctx); PlayerInputs.Player.Menu.performed += ctx => OnMenu(ctx); PlayerInputs.Player.Sprint.performed += ctx => OnSprint(ctx); }
private void OnEnable() { if (PlayerInputs != null) { PlayerInputs.Enable(); } }
private void Awake() { PlayerInputs = new WorldTriggerInputs(); PlayerInputs.Enable(); PlayerInputs.Player.Move.performed += ctx => OnMove(ctx); PlayerInputs.Player.Look.performed += ctx => OnLook(ctx); PlayerInputs.Player.Melee.performed += ctx => OnMelee(ctx); PlayerInputs.Player.Jump.performed += ctx => OnJump(ctx); PlayerInputs.Player.LeanLeft.performed += ctx => OnLeanLeft(ctx); PlayerInputs.Player.LeanRight.performed += ctx => OnLeanRight(ctx); PlayerInputs.Player.Attach.performed += ctx => OnAttach(ctx); PlayerInputs.Player.Prone.performed += ctx => OnProne(ctx); PlayerInputs.Player.Crouch.performed += ctx => OnCrouch(ctx); PlayerInputs.Player.SwapToMainTriggerSlot1.performed += ctx => OnSwapToMainTriggerSlot1(ctx); PlayerInputs.Player.SwapToMainTriggerSlot2.performed += ctx => OnSwapToMainTriggerSlot2(ctx); PlayerInputs.Player.SwapToMainTriggerSlot3.performed += ctx => OnSwapToMainTriggerSlot3(ctx); PlayerInputs.Player.SwapToMainTriggerSlot4.performed += ctx => OnSwapToMainTriggerSlot4(ctx); PlayerInputs.Player.SwaptoSubTrigger1.performed += ctx => OnSwaptoSubTrigger1(ctx); PlayerInputs.Player.SwaptoSubTrigger2.performed += ctx => OnSwaptoSubTrigger2(ctx); PlayerInputs.Player.SwaptoSubTrigger3.performed += ctx => OnSwaptoSubTrigger3(ctx); PlayerInputs.Player.SwaptoSubTrigger4.performed += ctx => OnSwaptoSubTrigger4(ctx); PlayerInputs.Player.ToggleSwapRightMainTrigger.performed += ctx => OnToggleSwapRightMainTrigger(ctx); PlayerInputs.Player.ToggleSwapLeftMainTrigger.performed += ctx => OnToggleSwapLeftMainTrigger(ctx); PlayerInputs.Player.ToggleSwapRightSubTrigger.performed += ctx => OnToggleSwapRightSubTrigger(ctx); PlayerInputs.Player.ToggleSwapLeftSubTrigger.performed += ctx => OnToggleSwapLeftSubTrigger(ctx); PlayerInputs.Player.Info.performed += ctx => OnInfo(ctx); PlayerInputs.Player.Menu.performed += ctx => OnMenu(ctx); }
private void OnEnable() { PlayerInputs.Enable(); }