Exemplo n.º 1
0
 // 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;
     }
 }
Exemplo n.º 2
0
    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());
    }