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); } } }
public static bool GetButtonUp(FigmentButton buttonType) { return(!FigmentButtonPressed[(int)buttonType] && FigmentButtonPressedLastFrame[(int)buttonType]); }
public static bool GetButton(FigmentButton buttonType) { return(FigmentButtonPressed[(int)buttonType]); }
void UpdateButtonStateFromKeyboard(FigmentButton buttonType, KeyCode keyboardKey) { FigmentButtonPressedLastFrame[(int)buttonType] = FigmentButtonPressed[(int)buttonType]; FigmentButtonPressed[(int)buttonType] = Input.GetKey(keyboardKey); }