IEnumerator EnemyTelegraph() { billboardScript.EnemyTelegraph(); yield return(new WaitForSeconds(fireRate / 5)); Instantiate(enemyProjectile, transform.position, targetDirection); yield return(new WaitForSeconds(fireRate)); billboardScript.EnemyNeutral(); canFire = true; enemyShooting = EnemyTelegraph(); }
IEnumerator EnemyTelegraph() { billboardScript.EnemyTelegraph(); yield return(new WaitForSeconds(attackCooldown / 5)); isInvulnerable = true; hurtboxCollider.enabled = true; rb.AddForce(transform.forward * attackForce, ForceMode.Impulse); yield return(new WaitForSeconds(attackCooldown)); isInvulnerable = false; if (hurtboxCollider.enabled) { hurtboxCollider.enabled = false; } billboardScript.EnemyNeutral(); canAttack = true; enemyAttacking = EnemyTelegraph(); }