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