Example #1
0
    IEnumerator Dead()
    {
        if (randomSpawn)
        {
            enemySpawner.ChangeEnemyCount();
            this.gameObject.SetActive(false);
        }
        yield return(new WaitForSeconds(coolDownInSec));

        //GetComponent<SpriteRenderer>().color = Color.green;
        animator.SetTrigger("Alive");
        yield return(new WaitForSeconds(1f));

        dead = false;
        life = maxLife;
    }