// Update is called once per frame IEnumerator _Update1() { while (true) { yield return(new WaitForSeconds(2.0f)); float dir = GetAim(); Bullet.Add(X, Y, dir, 3); } }
/// 更新 IEnumerator _Update1() { while (true) { // 2秒おきに弾を撃つ yield return(new WaitForSeconds(2.0f)); // 狙い撃ち角度を取得 float dir = GetAim(); Bullet.Add(X, Y, dir, 2); } }
IEnumerator _Update2() { // 発射角度を回転しながら撃つ yield return(new WaitForSeconds(2.0f)); float dir = 0; while (true) { Bullet.Add(X, Y, dir, 2); dir += 16; yield return(new WaitForSeconds(0.1f)); } }
/// 弾を発射する void DoBullet(float direction, float speed) { Bullet.Add(X, Y, direction, speed); }