// Update is called once per frame void FixedUpdate() { if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.UpArrow)) { fencer.Move(1); //advancing return; } if (Input.GetKey(KeyCode.S) || Input.GetKey(KeyCode.DownArrow)) { fencer.Move(-1); //retreating return; } }
public IEnumerator InputMove(int zDir) { yield return(new WaitForSeconds(reactTime * Time.deltaTime)); for (int c = 0; c < lagTolerance; c++) { opponent.Move(zDir); yield return(null); } StartCoroutine(Evaluate()); }