Exemple #1
0
 private bool OnAction(InputEvents.ActionEvent evt)
 {
     InputEvents.Actions action = evt.Action;
     if (action == InputEvents.Actions.Action1 && !swimController.TriggerQuickResurface)
     {
         swimController.TriggerQuickResurface = true;
         showResurfacePrompt();
     }
     return(false);
 }
        private bool OnActionEnabled(InputEvents.ActionEnabledEvent evt)
        {
            LocomotionController currentController = tracker.GetCurrentController();

            if (currentController != null)
            {
                InputEvents.Actions action = evt.Action;
                if (action == InputEvents.Actions.Snowball)
                {
                    currentController.EnableAction(LocomotionController.LocomotionAction.ChargeThrow, evt.Enabled);
                }
            }
            return(false);
        }
        private void processEvent(InputEvents.Actions action, long sessionId = 0L)
        {
            if (base.gameObject.IsDestroyed())
            {
                return;
            }
            bool       flag          = isMatchingProp(0L);
            GameObject playerGameObj = getPlayerGameObj(sessionId);
            float      num           = float.MaxValue;

            if (playerGameObj != null)
            {
                num = Vector2.Distance(new Vector2(playerGameObj.transform.position.x, playerGameObj.transform.position.z), new Vector2(base.transform.position.x, base.transform.position.z));
            }
            bool flag2 = num <= PropTriggerDistance;
            int  num2;

            switch (action)
            {
            case InputEvents.Actions.Jump:
                resetAnimTrigger(AnimAnticipationStart);
                resetAnimTrigger(AnimAnticipationStop);
                setAnimTrigger(AnimAnticipationStop);
                return;

            default:
                num2 = ((action != InputEvents.Actions.Action3) ? 1 : 0);
                break;

            case InputEvents.Actions.Action1:
            case InputEvents.Actions.Action2:
                num2 = 0;
                break;
            }
            if (num2 == 0 && currentHitPoints > 0)
            {
                CoroutineRunner.StopAllForOwner(this);
                CancelInvoke();
                if (flag && flag2)
                {
                    CoroutineRunner.Start(delayedDamageItemStart(0.2f, playerGameObj), this, "delayedDamageItemStart");
                    resetAnimTrigger(AnimAnticipationStart);
                    setAnimTrigger(AnimAnticipationStart);
                }
            }
        }