// Update is called once per frame protected override void OverrideUpdate() { actTime++; if (actTime > 120 - level * 15) { actTime = 0; switch (sw) { case 0: Jump(); sw = 1; break; case 1: anm.Attack(); sw = 0; kb = 0.3f; StartCoroutine(Shot()); break; } } Move(); KB(); Grav(); }
IEnumerator Shot() { for (int i = 0; i < 4 + level; i++) { anm.Attack(); Instantiate(bullet, new Vector3(direction == true?transform.position.x + 0.2f:transform.position.x - 0.2f, transform.position.y + 0.25f, 2), Quaternion.identity); //b.GetComponent<Boss02Bullet> ().Direction(direction); yield return(new WaitForSeconds(0.65f - 0.1f * level)); } }
IEnumerator Shot() { for (int i = 0; i < 4 + level; i++) { anm.Attack(); GameObject b = (GameObject)Instantiate(bullet, new Vector3(direction == true?transform.position.x + 0.2f:transform.position.x - 0.2f, transform.position.y, 0), Quaternion.identity); b.GetComponent <Boss03Bullet> ().Direction(direction, 1 + i); EventManager.Invoke(ref EventManager.OnFire); yield return(new WaitForSeconds(0.25f - 0.03f * level)); } }