Exemplo n.º 1
0
    private IEnumerator DoDamage(GameObject city)
    {
        while (city.activeSelf)
        {
            yield return(new WaitForSeconds(cooldown));

            if (city == null || !city.activeSelf)
            {
                yield break;
            }

            if (city.GetComponent <Health>().DoDamage(power))
            {
                Game_manager.KillCity(city.GetComponent <Stadt>());
            }
        }
    }