public override void GameAI(float Duration, Vector2 PanelPosition) { Player clientPlayer = Main.LocalPlayer; EntrogicPlayer clientModPlayer = EntrogicPlayer.ModPlayer(clientPlayer); if (Duration >= 3.2f && Main.rand.NextBool(3)) { MushroomBullet bullet = new MushroomBullet() { Velocity = new Vector2(0f, Main.rand.NextFloat(1f, 3f)), Position = new Vector2(Main.rand.Next((int)PlaygroundSize.X), -50f), UIPosition = PanelPosition }; clientModPlayer._bullets.Add(bullet); } }
IEnumerator ShotMushroomCoroutine() { float deltaTime = specialPattern2ShotDelay; // 버섯탄은 화면 좌측에서 생성되어 일정 거리를 날아간 후 폭발한다 Vector3 mPosition = new Vector3(-7.5f + Random.Range(-0.5f, 0.5f), Random.Range(-5.0f, 5.0f), 0); GameObject newBullet = Instantiate(specialBullet2Obj, mPosition, Quaternion.identity) as GameObject; Vector3 direction = FindObjectOfType <Player>().transform.position - transform.position; direction.y += Random.Range(-0.5f, 0.5f); Bullet bullet = newBullet.GetComponent <Bullet>(); bullet.direction = direction; bullet.speed = specialBullet2Speed; MushroomBullet mBullet = newBullet.GetComponent <MushroomBullet>(); mBullet.mushroomSubBulletObj = specialBullet2SubObj; mBullet.subBulletCount = specialBullet2SubCount; mBullet.subBulletSpeed = specialBullet2SubSpeed; mBullet.selfDestroy = true; mBullet.selfDestroyDelay = specialBullet2SelfDestroyDelay + Random.Range(0.0f, 3.0f); yield return(new WaitForSeconds(deltaTime)); }