Пример #1
0
        private bool OnChargeAction(InputEvents.ChargeActionEvent evt)
        {
            LocomotionController currentController = tracker.GetCurrentController();

            if (currentController != null && evt.Action == InputEvents.ChargeActions.Snowball)
            {
                if (evt.ButtonState)
                {
                    currentController.DoAction(LocomotionController.LocomotionAction.ChargeThrow);
                }
                else
                {
                    currentController.DoAction(LocomotionController.LocomotionAction.LaunchThrow, evt.HoldTime);
                }
            }
            return(false);
        }
Пример #2
0
        private bool OnAction(InputEvents.ActionEvent evt)
        {
            LocomotionController currentController = tracker.GetCurrentController();

            if (currentController != null)
            {
                switch (evt.Action)
                {
                case InputEvents.Actions.Jump:
                    if (SceneRefs.ActionSequencer != null)
                    {
                        SceneRefs.ActionSequencer.UserInputReceived();
                    }
                    currentController.DoAction(LocomotionController.LocomotionAction.Jump);
                    break;

                case InputEvents.Actions.Torpedo:
                    if (SceneRefs.ActionSequencer != null)
                    {
                        SceneRefs.ActionSequencer.UserInputReceived();
                    }
                    currentController.DoAction(LocomotionController.LocomotionAction.Torpedo);
                    break;

                case InputEvents.Actions.Interact:
                    if (!Service.Get <PropService>().IsLocalUserUsingProp() || Service.Get <PropService>().CanActionsBeUsedWithProp())
                    {
                        if (SceneRefs.ActionSequencer != null)
                        {
                            SceneRefs.ActionSequencer.UserInputReceived();
                        }
                        currentController.DoAction(LocomotionController.LocomotionAction.Interact);
                    }
                    break;

                case InputEvents.Actions.Action1:
                    if (SceneRefs.ActionSequencer != null)
                    {
                        SceneRefs.ActionSequencer.UserInputReceived();
                    }
                    currentController.DoAction(LocomotionController.LocomotionAction.Action1);
                    break;

                case InputEvents.Actions.Action2:
                    if (SceneRefs.ActionSequencer != null)
                    {
                        SceneRefs.ActionSequencer.UserInputReceived();
                    }
                    currentController.DoAction(LocomotionController.LocomotionAction.Action2);
                    break;

                case InputEvents.Actions.Action3:
                    if (SceneRefs.ActionSequencer != null)
                    {
                        SceneRefs.ActionSequencer.UserInputReceived();
                    }
                    currentController.DoAction(LocomotionController.LocomotionAction.Action3);
                    break;
                }
            }
            return(false);
        }