Exemple #1
0
 private void ExecuteClick(JoyButtonState state, int i)
 {
     switch (state)
     {
     case JoyButtonState.Pressed:
         SimulatorMethods.KeyDown(keyCode[i]);
         CoroutineMaster.ExecuteAfterNFrames(
             1, delegate { SimulatorMethods.KeyUp(keyCode[i]); }
             );
         break;
     }
 }
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     if (sim == null)
     {
         sim = new InputSimulator();
     }
     screenSize       = new Vector2(UnityEngine.Screen.currentResolution.width, UnityEngine.Screen.currentResolution.height);
     xOnePixelSimSize = scaledSimSize / screenSize.x;
     yOnePixelSimSize = scaledSimSize / screenSize.y;
 }
Exemple #3
0
    private void ExecuteHold(JoyButtonState state, int i)
    {
        switch (state)
        {
        case JoyButtonState.Pressed:
            SimulatorMethods.KeyDown(keyCode[i]);
            break;

        case JoyButtonState.Hold:
            SimulatorMethods.KeyDown(keyCode[i]);
            break;

        case JoyButtonState.Realesed:
            SimulatorMethods.KeyUp(keyCode[i]);
            break;

        case JoyButtonState.None:
            break;
        }
    }
Exemple #4
0
    private void ExecuteReleaseOnSecondClick(JoyButtonState state, int i)
    {
        switch (state)
        {
        case JoyButtonState.Pressed:
            isPressed = !isPressed;
            if (isPressed)
            {
                SimulatorMethods.KeyDown(keyCode[i]);
            }
            else
            {
                SimulatorMethods.KeyUp(keyCode[i]);
            }
            break;

        default:
            if (isPressed)
            {
                SimulatorMethods.KeyDown(keyCode[i]);
            }
            break;
        }
    }