RB.KeyPressed
Method - Static
public static bool KeyPressed(KeyCode keyCode, int repeatRate = 0)
|
Parameters
keyCode
|
KeyCode
|
Key code
|
repeatRate
|
int
|
Key repeat rate in frames, if > 0 then the button will re-trigger at this repeat rate
|
Returns
bool
True if key pressed
DescriptionReturn true if given key specified by keyCode went from an up to down state since last call to IRetroBlitGame.Update. Examplevoid Update() { if (RB.KeyPressed(UnityEngine.KeyCode.Z)) { DrinkPotion(); } } |
See AlsoRB.KeyReleased RB.KeyDown RB.InputStringSee DocsFeatures - Keyboard |