Exemple #1
0
    void LaunchButtonEventsFromKeyboard(FigmentButton buttonType, KeyCode keyboardKey)
    {
        if (Input.GetKeyDown(keyboardKey))
        {
            if (OnButtonDown != null)
            {
                OnButtonDown(buttonType);
            }
        }

        if (Input.GetKey(keyboardKey))
        {
            if (OnButtonHold != null)
            {
                OnButtonHold(buttonType);
            }
        }

        if (Input.GetKeyUp(keyboardKey))
        {
            if (OnButtonUp != null)
            {
                OnButtonUp(buttonType);
            }
        }
    }
Exemple #2
0
 public static bool GetButtonUp(FigmentButton buttonType)
 {
     return(!FigmentButtonPressed[(int)buttonType] && FigmentButtonPressedLastFrame[(int)buttonType]);
 }
Exemple #3
0
 public static bool GetButton(FigmentButton buttonType)
 {
     return(FigmentButtonPressed[(int)buttonType]);
 }
Exemple #4
0
 void UpdateButtonStateFromKeyboard(FigmentButton buttonType, KeyCode keyboardKey)
 {
     FigmentButtonPressedLastFrame[(int)buttonType] = FigmentButtonPressed[(int)buttonType];
     FigmentButtonPressed[(int)buttonType]          = Input.GetKey(keyboardKey);
 }