//オプションが蜂の時のショット private void Bee_Shoot() { ObjectPool bullet_Pool = ObjectPoolManager.Instance.Get_Pool("PlayerBeeBullet"); for (int i = 0; i < 3; i++) { var bullet = bullet_Pool.GetObject(); bullet.transform.position = transform.position + new Vector3(0, -6f + i * 6f); bullet.transform.localScale = transform.localScale; bullet.GetComponent <Rigidbody2D>().velocity = new Vector2(900f * transform.localScale.x, 0); } player_SE.Play_Shoot_Sound(); }
private IEnumerator Shoot_Cor(ShootStatus s) { for (int i = 0; i < 3; i++) { for (int j = 0; j < s.num; j++) { GameObject bullet = s.bullet_Pool.GetObject(); bullet.transform.position = transform.position; bullet.transform.position += new Vector3(0, (-s.width * s.num) / 2) + new Vector3(0, s.width * j); bullet.transform.localScale = transform.localScale; bullet.GetComponent <Rigidbody2D>().velocity = new Vector2(s.bullet_Speed * transform.localScale.x, 0); if (s.bullet_Pool == ObjectPoolManager.Instance.Get_Pool(spider_Bullet)) { Add_Diffusion_Shoot_Vel(bullet, s.num, j); } else if (s.bullet_Pool == ObjectPoolManager.Instance.Get_Pool(butterfly_Bullet)) { Add_Diffusion_Shoot_Vel(bullet, s.num, j); } player_SE.Play_Shoot_Sound(); bullet.GetComponent <Bullet>().Set_Inactive(10); } yield return(new WaitForSeconds(s.span)); } }
//オプションが蜂の時のショット private IEnumerator Bee_Shoot_Cor() { ObjectPool bullet_Pool = ObjectPoolManager.Instance.Get_Pool("PlayerBeeBullet"); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { var bullet = bullet_Pool.GetObject(); bullet.transform.position = transform.position + new Vector3(0, -6f + j * 6f); bullet.transform.localScale = transform.localScale; bullet.GetComponent <Rigidbody2D>().velocity = new Vector2(900f * transform.localScale.x, 0); } player_SE.Play_Shoot_Sound(); yield return(new WaitForSeconds(0.1f)); } }