/** * Acting! */ public IEnumerator InputAttack() { yield return(new WaitForSeconds(reactTime * Time.deltaTime)); for (int c = 0; c < lagTolerance; c++) { opponent.Attack(); yield return(null); } StartCoroutine(Evaluate()); }
void Update() { if (Input.GetButtonDown("Fire1")) { fencer.Attack(); return; } if (Input.GetButtonDown("Fire2")) { StartCoroutine(fencer.Parry()); return; } }