IEnumerator InfectAnimation(TagNPCMove victim) { Instantiate(infectParticlePrefab, victim.transform.position, Quaternion.Euler(-90, 0, 0), victim.transform); for (int i = 10; i >= 1; i--) { victim.walkSpeed = (0.008f) * i; yield return(new WaitForSeconds(1.7f / 10)); } zombies.Add(victim.Infect()); }
public bool InfectOne() { if (npcs.Count <= 0) { return(false); } TagNPCMove victim = npcs[Random.Range(0, npcs.Count - 1)]; npcs.Remove(victim); StartCoroutine(InfectAnimation(victim)); return(true); }