IEnumerator Shoot() { while (state == 0) { straightBullet.SpawnSingleBullet(7f); yield return(new WaitForSeconds(2)); } while (state == 1) { StartCoroutine(straightBullet.SpawnBullets(10, 7f)); yield return(new WaitForSeconds(5)); } while (state == 2) { StartCoroutine(straightBullet.SpawnBullets(10, 7f)); animator.SetBool("Shoot", true); yield return(new WaitForSeconds(3)); animator.SetBool("Shoot", false); yield return(new WaitForSeconds(3)); } }
IEnumerator Shoot() { while (state == 0) { radicalBullet.SpawnProjectile(50, transform.position, 7f); yield return(new WaitForSeconds(2)); } while (state == 1) { StartCoroutine(straightBullet.SpawnBullets(10, 7f)); yield return(new WaitForSeconds(2)); } while (state == 2) { StartCoroutine(spiralBullet.SpawnProjectile(10, transform.position, 7f)); yield return(new WaitForSeconds(7)); } while (state == 3) { StartCoroutine(spiralMultiBullet.SpawnSpiralMultiProjectile(transform.position, 7f)); yield return(new WaitForSeconds(7)); } /* * while (state == 0) * { * straightBullet.SpawnSingleBullet(7f); * yield return new WaitForSeconds(2); * } * while (state == 1) * { * StartCoroutine(straightBullet.SpawnBullets(10, 7f)); * yield return new WaitForSeconds(5); * } * while (state == 2) * { * StartCoroutine(straightBullet.SpawnBullets(10, 7f)); * animator.SetBool("Shoot", true); * yield return new WaitForSeconds(3); * animator.SetBool("Shoot", false); * yield return new WaitForSeconds(3); * } */ }