private int _patternDPartDuration = 60 * 14; // 패턴 D의 파트별 지속시간 public IEnumerator Pattern_08(Mover mover) { // 안전선 발사 PatternD_2_SafetyLine(); // 보스 기준위치로 이동 yield return(StartCoroutine(MoveConstantVelocity(mover, new Vector2(0.0f, 0.75f), 240))); yield return(new WaitForFrames(240)); // 반원 발사 const float speed1 = 0.05f; const float speed2 = 0.01f; const int phase1Duration = 30; const int count = 5; const float angleRange = 100.0f / 360.0f; const float startAngleOffset = (angleRange / (float)(count - 1)) / 2.0f; const int interval = 30; const string shape = BulletName.blue; for (int frame = 0; frame < (_patternDPartDuration / 2); ++frame) { if (frame % interval == 0) { float startAngle = 0.75f + GameSystem._Instance.GetRandomRange(-startAngleOffset, startAngleOffset); for (int i = 0; i < count; ++i) { PlacedBullet b = GameSystem._Instance.CreateBullet <PlacedBullet>(); b.InitNoStop(shape, mover._X, mover._Y, startAngle + angleRange * ((float)i / (count - 1) - 0.5f), speed1 , phase1Duration, 0.75f, speed2); } } yield return(null); } }
// sup /// 이후 패턴을 위한 안전선 public void PatternD_2_SafetyLine() { const float speed1 = 0.0045f; const float speed2 = 0.01f; const int phase1Duration = 480; const int count = 10; const string shape = BulletName.red; float startX = GameSystem._Instance._MinX; float gapX = (GameSystem._Instance._MaxX - GameSystem._Instance._MinX) / (count - 1); float y = GameSystem._Instance._MaxY; for (int i = 0; i < count; ++i) { // 아래로 내려오다가 // 페이즈 2 때 절반은 왼쪽으로, 절반은 오른쪽으로 사라짐 PlacedBullet b = GameSystem._Instance.CreateBullet <PlacedBullet>(); b.InitNoStop(shape, startX + (i * gapX), y, 0.75f, speed1 , phase1Duration, (i < (count / 2) ? 0.5f : 0.0f), speed2); } }