Esempio n. 1
0
    private static UInt32 ProcessInput(Boolean isTriggerDirection, Boolean isTriggerButton)
    {
        UInt32  num    = 0u;
        Vector2 vector = Vector2.zero;

        if (VirtualAnalog.HasInput())
        {
            vector = VirtualAnalog.GetAnalogValue();
            if (Mathf.Abs(vector.x) >= 0.1f || Mathf.Abs(vector.y) >= 0.1f)
            {
                if (vector.y > 0f)
                {
                    num |= 16u;
                }
                if (vector.y < 0f)
                {
                    num |= 64u;
                }
                if (vector.x < 0f)
                {
                    num |= 128u;
                }
                if (vector.x > 0f)
                {
                    num |= 32u;
                }
            }
        }
        if (EventInput.GetKey(Control.Menu, isTriggerButton))
        {
            num |= 16781312u;
            EventInput.InputLog("Press /_\\");
        }
        if (EventInput.GetKey(Control.Confirm, isTriggerButton))
        {
            num |= (8192u | EventInput.Lcircle);
            EventInput.InputLog("Press 0");
        }
        if (EventInput.GetKey(Control.Cancel, isTriggerButton))
        {
            num |= (16384u | EventInput.Lx);
            EventInput.InputLog("Press X");
        }
        if (EventInput.GetKey(Control.Special, isTriggerButton))
        {
            num |= 557056u;
            EventInput.InputLog("Press []");
        }
        if (EventInput.GetKey(Control.Select, isTriggerButton))
        {
            num |= 1u;
            EventInput.InputLog("Press Select");
        }
        if (EventInput.GetKey(Control.Pause, isTriggerButton))
        {
            num |= 8u;
            EventInput.InputLog("Press Start");
        }
        if (EventInput.GetKey(Control.LeftBumper, isTriggerButton))
        {
            num |= 1049600u;
            EventInput.InputLog("Press L1");
        }
        if (EventInput.GetKey(Control.RightBumper, isTriggerButton))
        {
            num |= 2099200u;
            EventInput.InputLog("Press R1");
        }
        if (EventInput.GetKey(Control.LeftTrigger, isTriggerButton))
        {
            num |= 4194560u;
            EventInput.InputLog("Press L2");
        }
        if (EventInput.GetKey(Control.RightTrigger, isTriggerButton))
        {
            num |= 8389120u;
            EventInput.InputLog("Press R2");
        }
        if (EventInput.GetKey(Control.Up, isTriggerDirection))
        {
            num |= 16u;
            EventInput.InputLog("Press ^");
        }
        if (EventInput.GetKey(Control.Down, isTriggerDirection))
        {
            num |= 64u;
            EventInput.InputLog("Press v");
        }
        if (EventInput.GetKey(Control.Left, isTriggerDirection))
        {
            num |= 128u;
            EventInput.InputLog("Press <");
        }
        if (EventInput.GetKey(Control.Right, isTriggerDirection))
        {
            num |= 32u;
            EventInput.InputLog("Press >");
        }
        return(num);
    }