protected override IEnumerator SpellZero() { yield return(new WaitForEndOfFrame()); yield return(new WaitForEndOfFrame()); float wait = (animator.GetCurrentAnimatorStateInfo(0).length *animator.GetCurrentAnimatorStateInfo(0).speed); float offset = 0f; yield return(new WaitForSeconds(wait)); for (int i = 0; i < 10; i++) { List <Vector3> startPositions = SimpleFunctions.RandomCircle(bulStartPoint.position, 0.5f, 18, offset); List <Vector3> endPositions = SimpleFunctions.RandomCircle(bulStartPoint.position, 1.0f, 18, offset); for (int j = 0; j < startPositions.Count; j++) { BulletInfo bul = new BulletInfo(startPositions[j], endPositions[j], bullet_speed, 1, 1, 1); Bullet bullet = Instantiate(bulletObj, startPositions[j], Quaternion.identity).GetComponent <Bullet>(); bullet.Setup(bul, 1, transform.rotation, false); } yield return(new WaitForSeconds(0.5f)); offset += 5f; } yield return(new WaitForEndOfFrame()); }
protected override IEnumerator CastSpell() { while (isAlive) { List <Vector3> startPositions = SimpleFunctions.RandomCircle(transform.position, 0.5f, 4, 0); List <Vector3> endPositions = SimpleFunctions.RandomCircle(transform.position, 1.0f, 4, 0); for (int j = 0; j < startPositions.Count; j++) { BulletInfo bul = new BulletInfo(startPositions[j], endPositions[j], bulSpeed, 1, 1, 1); Bullet bullet = Instantiate(bulletObj, startPositions[j], Quaternion.identity).GetComponent <Bullet>(); bullet.Setup(bul, 1, transform.rotation, false); } yield return(new WaitForSeconds(timeBetweenAttack)); } }
protected override IEnumerator SpellZero() { List <Vector3> startPositions = SimpleFunctions.RandomCircle(bulStartPoint.position, 0.5f, 4, 0); List <Vector3> endPositions = SimpleFunctions.RandomCircle(bulStartPoint.position, 1.0f, 4, 0); for (int j = 0; j < startPositions.Count; j++) { BulletInfo bul = new BulletInfo(startPositions[j], endPositions[j], bullet_speed, 1, 1, 1); Bullet bullet = Instantiate(bulletObj, startPositions[j], Quaternion.identity).GetComponent <Bullet>(); bullet.Setup(bul, 1, transform.rotation, false); } yield return(new WaitForSeconds(0.5f)); yield return(new WaitForEndOfFrame()); }