Beispiel #1
0
 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>();
 }
Beispiel #2
0
 public static bool KeyDown(Key key)
 {
     return(keysDown.Contains(key));
 }
Beispiel #3
0
 public bool IsKeyDown(Key key)
 {
     return keyStates[(int)key];
 }
Beispiel #4
0
 public static bool KeyRelease(Key key)
 {
     return(!keysDown.Contains(key) && keysDownLast.Contains(key));
 }
Beispiel #5
0
 public static bool KeyPress(Key key)
 {
     return(keysDown.Contains(key) && !keysDownLast.Contains(key));
 }
Beispiel #6
0
 public bool KeyDown(Key input)
 {
     return KeyCurrent.IsKeyDown(input) && Focus;
 }
Beispiel #7
0
 public bool KeyRelease(Key input)
 {
     return !KeyCurrent.IsKeyDown(input) &&
         KeyPrevious.IsKeyDown(input) &&
         Focus;
 }
Beispiel #8
0
 public bool KeyPress(Key input)
 {
     return KeyCurrent.IsKeyDown(input) &&
         !KeyPrevious.IsKeyDown(input) &&
         Focus;
 }