void setAgents() { player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerMovement>(); GameObject[] foesList = GameObject.FindGameObjectsWithTag("Foe"); foes = new GhostMovement[foeNumber]; for (int i = 0; i < foeNumber; i++) { foes[i] = foesList[i].GetComponent<GhostMovement>(); } key = GameObject.FindGameObjectWithTag("Key").GetComponent<Key>(); }
public static bool KeyDown(Key key) { return(keysDown.Contains(key)); }
public bool IsKeyDown(Key key) { return keyStates[(int)key]; }
public static bool KeyRelease(Key key) { return(!keysDown.Contains(key) && keysDownLast.Contains(key)); }
public static bool KeyPress(Key key) { return(keysDown.Contains(key) && !keysDownLast.Contains(key)); }
public bool KeyDown(Key input) { return KeyCurrent.IsKeyDown(input) && Focus; }
public bool KeyRelease(Key input) { return !KeyCurrent.IsKeyDown(input) && KeyPrevious.IsKeyDown(input) && Focus; }
public bool KeyPress(Key input) { return KeyCurrent.IsKeyDown(input) && !KeyPrevious.IsKeyDown(input) && Focus; }