示例#1
0
        public override void OnUpdate()
        {
            IVR.ControllerInputSide controller = (controllerSide == BodySide.Left) ? controller0.left : controller0.right;

            bool oldBool = storeBool.Value;

            switch (button)
            {
            case IVR.ControllerInput.Button.StickButton:
                storeBool.Value  = controller.stickButton;
                storeFloat.Value = controller.stickButton ? 1 : 0;
                break;

            case IVR.ControllerInput.Button.Up:
                storeBool.Value  = controller.up;
                storeFloat.Value = controller.up ? 1 : 0;
                break;

            case IVR.ControllerInput.Button.Down:
                storeBool.Value  = controller.down;
                storeFloat.Value = controller.down ? 1 : 0;
                break;

            case IVR.ControllerInput.Button.Left:
                storeBool.Value  = controller.left;
                storeFloat.Value = controller.left ? 1 : 0;
                break;

            case IVR.ControllerInput.Button.Right:
                storeBool.Value  = controller.right;
                storeFloat.Value = controller.right ? 1 : 0;
                break;

            case IVR.ControllerInput.Button.ButtonOne:
                storeBool.Value  = controller.buttons[0];
                storeFloat.Value = controller.buttons[0] ? 1 : 0;
                break;

            case IVR.ControllerInput.Button.ButtonTwo:
                storeBool.Value  = controller.buttons[1];
                storeFloat.Value = controller.buttons[1] ? 1 : 0;
                break;

            case IVR.ControllerInput.Button.ButtonThree:
                storeBool.Value  = controller.buttons[2];
                storeFloat.Value = controller.buttons[2] ? 1 : 0;
                break;

            case IVR.ControllerInput.Button.ButtonFour:
                storeBool.Value  = controller.buttons[3];
                storeFloat.Value = controller.buttons[3] ? 1 : 0;
                break;

            case IVR.ControllerInput.Button.Option:
                storeBool.Value  = controller.option;
                storeFloat.Value = controller.option ? 1 : 0;
                break;

            case IVR.ControllerInput.Button.Bumper:
                storeBool.Value  = controller.bumper > 0.9F;
                storeFloat.Value = controller.bumper;
                break;

            case IVR.ControllerInput.Button.Trigger:
                storeBool.Value  = controller.trigger > 0.9F;
                storeFloat.Value = controller.trigger;
                break;
            }

            if (storeBool.Value && !oldBool)
            {
                Fsm.Event(buttonPressed);
            }
            else if (!storeBool.Value && oldBool)
            {
                Fsm.Event(buttonReleased);
            }
        }
示例#2
0
        public override void OnUpdate()
        {
            IVR.ControllerInputSide controller = (controllerSide == BodySide.Left) ? controller0.left : controller0.right;

            storeVector.Value = new Vector3(controller.stickHorizontal, 0, controller.stickVertical);
        }