void Bounce() { int index = 4 + 11 * WayDir; switch (WayDir) { case 0: case 1: for (int i = -1; i <= 1; i += 2) { GameObject obj = GameManager.Inst().ObjManager.MakeObj("BossOneWay"); index += i; obj.transform.position = SpreadPoses[index].transform.position; obj.transform.rotation = SpreadPoses[index].transform.rotation; BossBounce bullet = obj.gameObject.GetComponent <BossBounce>(); bullet.SetStartPos(obj.transform.position); bullet.Shoot(obj.transform.up); } break; case 2: for (int i = 0; i < 2; i++) { GameObject obj = GameManager.Inst().ObjManager.MakeObj("BossOneWay"); index = 4 + 11 * i; obj.transform.position = SpreadPoses[index].transform.position; obj.transform.rotation = SpreadPoses[index].transform.rotation; BossBounce bullet = obj.gameObject.GetComponent <BossBounce>(); bullet.SetStartPos(obj.transform.position); bullet.Shoot(obj.transform.up); } break; } GameManager.Inst().SodManager.PlayEffect("Bs_OneWay"); }
void Shot() { int maxCount = 6; float shotTime = 0.0f; switch (GameManager.Inst().StgManager.Stage) { case 1: shotTime = 0.1f; for (int i = 0; i < 12; i++) { GameObject obj = GameManager.Inst().ObjManager.MakeObj("BossNormal"); obj.transform.position = ShotDir[i].transform.position; obj.transform.rotation = ShotDir[i].transform.rotation; BossNormal bullet = obj.gameObject.GetComponent <BossNormal>(); bullet.Shoot(ShotDir[i].transform.up); } GameManager.Inst().SodManager.PlayEffect("Bs_Normal"); break; case 2: maxCount = 2; shotTime = 0.1f; for (int i = 0; i < 4; i++) { GameObject obj = GameManager.Inst().ObjManager.MakeObj("BossOneWay"); obj.transform.position = ShotDir[ShotCount + i * 3].transform.position; obj.transform.rotation = ShotDir[ShotCount + i * 3].transform.rotation; BossBounce bullet = obj.GetComponent <BossBounce>(); bullet.SetStartPos(obj.transform.position); bullet.Shoot(obj.transform.up); } GameManager.Inst().SodManager.PlayEffect("Bs_OneWay"); break; case 3: maxCount = 12; shotTime = 0.05f; for (int i = 0; i < 1; i++) { GameObject obj = GameManager.Inst().ObjManager.MakeObj("BossNormal"); obj.transform.position = ShotDir[ShotCount].transform.position; obj.transform.rotation = ShotDir[ShotCount].transform.rotation; BossBoomerang bullet = obj.GetComponent <BossBoomerang>(); bullet.StartMove(obj.transform.position); } GameManager.Inst().SodManager.PlayEffect("Bs_Normal"); break; case 4: maxCount = 5; shotTime = 0.1f; int rand = Random.Range(0, 12); for (int i = 0; i < 6; i++) { GameObject obj = GameManager.Inst().ObjManager.MakeObj("BossOneWay"); obj.transform.position = ShotDir[0].transform.position; obj.transform.rotation = ShotDir[(rand + (i % 2) * 6) % 12].transform.rotation; BossNormal bullet = obj.gameObject.GetComponent <BossNormal>(); bullet.Shoot(ShotDir[(rand + (i % 2) * 6) % 12].transform.up, rand % 5 + 1); rand++; } GameManager.Inst().SodManager.PlayEffect("Bs_OneWay"); break; case 5: shotTime = 0.1f; for (int i = 0; i < 2; i++) { GameObject obj = GameManager.Inst().ObjManager.MakeObj("BossOneWay"); obj.transform.position = ShotDir[ShotCount + i * 6].transform.position; obj.transform.rotation = ShotDir[ShotCount + i * 6].transform.rotation; BossLaser bullet = obj.GetComponent <BossLaser>(); bullet.StopTime = 0.0f; } GameManager.Inst().SodManager.PlayEffect("Bs_Laser"); break; } //GameManager.Inst().SodManager.PlayEffect("Bigbullet trigger"); ShotCount++; if (ShotCount >= maxCount) { Die(); } else { Invoke("Shot", shotTime); } }