コード例 #1
0
    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();
    }
コード例 #2
0
    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();
    }