示例#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>();
 }
示例#2
0
 public static bool KeyDown(Key key)
 {
     return(keysDown.Contains(key));
 }
示例#3
0
 public bool IsKeyDown(Key key)
 {
     return keyStates[(int)key];
 }
示例#4
0
 public static bool KeyRelease(Key key)
 {
     return(!keysDown.Contains(key) && keysDownLast.Contains(key));
 }
示例#5
0
 public static bool KeyPress(Key key)
 {
     return(keysDown.Contains(key) && !keysDownLast.Contains(key));
 }
示例#6
0
文件: Input.cs 项目: AyyTee/Aventyr
 public bool KeyDown(Key input)
 {
     return KeyCurrent.IsKeyDown(input) && Focus;
 }
示例#7
0
文件: Input.cs 项目: AyyTee/Aventyr
 public bool KeyRelease(Key input)
 {
     return !KeyCurrent.IsKeyDown(input) &&
         KeyPrevious.IsKeyDown(input) &&
         Focus;
 }
示例#8
0
文件: Input.cs 项目: AyyTee/Aventyr
 public bool KeyPress(Key input)
 {
     return KeyCurrent.IsKeyDown(input) &&
         !KeyPrevious.IsKeyDown(input) &&
         Focus;
 }