public BossAction() { MNG = MystGameManager.Instance; PRFB_GUIDE = Resources.Load("Prefabs/Effects/Guide") as GameObject; PRFB_BREAK = Resources.Load("Prefabs/Effects/Damage") as GameObject; PRFB_STORM = Resources.Load("Prefabs/Barrage/Storm_Tiny") as GameObject; PRFB_MEN_TARGET_LASER = Resources.Load("Prefabs/Barrage/WithEnemy/MystEnemy_Target_Laser") as GameObject; PRFB_LASER = Resources.Load("Prefabs/Barrage/Target_Laser") as GameObject; PRFB_BARRAGE_SAMPLE = Resources.Load("Prefabs/Barrage/SampleBarrage") as GameObject; PRFB_STORM_TOP = Resources.Load("Prefabs/Barrage/Storm_Top") as GameObject; PRFB_STORM_BOTTOM = Resources.Load("Prefabs/Barrage/Storm_Bottom") as GameObject; PRFB_TARGET = Resources.Load("Prefabs/Barrage/Target_Way") as GameObject; PRFB_LASER_WALL_TOP = Resources.Load("Prefabs/Barrage/Laser_Wall_Top") as GameObject; PRFB_LASER_WALL_BOTTOM = Resources.Load("Prefabs/Barrage/Laser_Wall_Bottom") as GameObject; PRFB_ROTATE = Resources.Load("Prefabs/Barrage/Rotate_Fixed") as GameObject; PRFB_STRATE = Resources.Load("Prefabs/Barrage/Strate_Quik") as GameObject; PRFB_WAVE = Resources.Load("Prefabs/Barrage/Wave") as GameObject; PRFB_CIRCLE = Resources.Load("Prefabs/Barrage/Circle") as GameObject; PRFB_MEN_TARGET2WAY = Resources.Load("Prefabs/Barrage/WithEnemy/MystEnemy_Target2Way") as GameObject; PRFB_MEN_HORMING_TARGET2WAY = Resources.Load("Prefabs/Barrage/WithEnemy/MystEnemyHorming_Target2Way") as GameObject; PRFB_STAR = Resources.Load("Prefabs/Barrage/Star") as GameObject; PRFB_PILLAR = Resources.Load("Prefabs/Barrage/Pillar") as GameObject; PRFB_MEN_HOPPER = Resources.Load("Prefabs/Barrage/WithEnemy/MystEnemyHopper_R") as GameObject; age = 0f; action_counter = 0f; boss_state = 0; }
public void Update() { // Debug.Log(this.mainCoroutine); if (MNG.boss_life <= (MNG.BOSS_LIFE_MAX / 3 * 2) && boss_state == 0) { this.Stop(); // 出した弾を消す var bullets = GameObject.FindGameObjectsWithTag("Bullet(Enemy)"); var enemies = GameObject.FindGameObjectsWithTag("Enemy"); foreach (var bullet in bullets) { var showEffect = Random.Range(0, 2); if (showEffect == 0) { MNG.objects.InstantiateTiny(PRFB_BREAK, bullet.transform.position); } MystGameManager.Destroy(bullet); } foreach (var enemy in enemies) { MystGameManager.Destroy(enemy); } boss_state = 1; this.currentCoroutine = MNG.StartCoroutine(this.SecondAction()); } if (MNG.boss_life <= (MNG.BOSS_LIFE_MAX / 3) && boss_state == 1) { this.Stop(); // 出した弾を消す var bullets = GameObject.FindGameObjectsWithTag("Bullet(Enemy)"); var enemies = GameObject.FindGameObjectsWithTag("Enemy"); foreach (var bullet in bullets) { var showEffect = Random.Range(0, 2); if (showEffect == 0) { MNG.objects.InstantiateTiny(PRFB_BREAK, bullet.transform.position); } MystGameManager.Destroy(bullet); } foreach (var enemy in enemies) { MystGameManager.Destroy(enemy); } boss_state = 2; this.currentCoroutine = MNG.StartCoroutine(this.ThirdAction()); } }
public void DestroyAll() { // Debug.Log(this.object_collection.Count); foreach (GameObject obj in this.object_collection) { if (obj != null) { Destroy(obj); } } // Debug.Log(this.object_collection.Count); var bullets = GameObject.FindGameObjectsWithTag("Bullet(Enemy)"); var enemies = GameObject.FindGameObjectsWithTag("Enemy"); foreach (var bullet in bullets) { MystGameManager.Destroy(bullet); } foreach (var enemy in enemies) { MystGameManager.Destroy(enemy); } }
public IEnumerator ThirdAction() { // フェーズ3 yield return(new WaitForSeconds(0.4f)); MNG.objects.InstantiateTiny(PRFB_STAR, MNG.FixedBossPosition()); var move_to_x_long = Random.Range( MNG.WINDOW_BOTTOM_RIGHT.x / 4 * 3, MNG.WINDOW_BOTTOM_RIGHT.x - 2); var move_to_y_long = Random.Range( MNG.WINDOW_BOTTOM_RIGHT.y + 2, MNG.WINDOW_TOP_LEFT.y - 2); iTween.MoveTo(MNG.GOBJ_BOSS, iTween.Hash( "x", move_to_x_long, "y", move_to_y_long, "time", 1f, "easeType", iTween.EaseType.linear )); yield return(new WaitForSeconds(1f)); for (;;) { // カエル var ENEMY_PUT_NUMBER = 20; for (int i = 0; i < ENEMY_PUT_NUMBER; i++) { var randomY = Random.Range(2f, MNG.WINDOW_TOP_LEFT.y - 2f); var enemyPos = new Vector2(MNG.WINDOW_TOP_LEFT.x, randomY); MNG.objects.InstantiateTiny(PRFB_GUIDE, enemyPos); yield return(new WaitForSeconds(0.1f)); MNG.objects.InstantiateTiny(PRFB_MEN_HOPPER, enemyPos); } yield return(new WaitForSeconds(1f)); move_to_x_long = Random.Range( MNG.WINDOW_BOTTOM_RIGHT.x / 4 * 3, MNG.WINDOW_BOTTOM_RIGHT.x - 2); move_to_y_long = Random.Range( MNG.WINDOW_BOTTOM_RIGHT.y + 2, MNG.WINDOW_TOP_LEFT.y - 2); iTween.MoveTo(MNG.GOBJ_BOSS, iTween.Hash( "x", move_to_x_long, "y", move_to_y_long, "time", 6f, "easeType", iTween.EaseType.linear )); // 星 var STAR_PUT_NUMBER = 2; for (int i = 0; i < STAR_PUT_NUMBER; i++) { MNG.objects.InstantiateTiny(PRFB_STAR, MNG.FixedBossPosition()); yield return(new WaitForSeconds(3f)); } yield return(new WaitForSeconds(2f)); move_to_x_long = Random.Range( MNG.WINDOW_BOTTOM_RIGHT.x / 4 * 3, MNG.WINDOW_BOTTOM_RIGHT.x - 2); move_to_y_long = Random.Range( MNG.WINDOW_BOTTOM_RIGHT.y + 2, MNG.WINDOW_TOP_LEFT.y - 2); iTween.MoveTo(MNG.GOBJ_BOSS, iTween.Hash( "x", move_to_x_long, "y", move_to_y_long, "time", 6f, "easeType", iTween.EaseType.linear )); var circle = MNG.objects.InstantiateTiny(PRFB_CIRCLE, MNG.FixedBossPosition()); circle.transform.SetParent(MNG.GOBJ_BOSS.transform); // 自機狙い柱を5~6回集中的に var PILLER_PUT_NUMBER = Random.Range(4, 6); var pillerY = MNG.WINDOW_TOP_LEFT.y; for (int i = 0; i < PILLER_PUT_NUMBER; i++) { var player_position = MNG.GOBJ_PLAYER.transform.position; var putPos = new Vector2(player_position.x, pillerY); MNG.objects.InstantiateTiny(PRFB_PILLAR, putPos); yield return(new WaitForSeconds(1f)); } yield return(new WaitForSeconds(8f)); MystGameManager.Destroy(circle); yield return(new WaitForSeconds(3f)); } }