// 默认进行欧拉角射击 private void DefaultShot() { shotDefault = true; waitSeconds = 0.1f; SetJudgePointMesh(false); shotIndex = m_Shot.StartEuler(bullet, bullets, shotNumber, eulerAngle, shotSpeed, waitSeconds); }
// 行为! private IEnumerator Haviour() { while (true) { m_Transform.position += new Vector3(1.0f, 00f, 0.0f); yield return(new WaitForSeconds(0.01f)); if (pos == m_Transform.position) { pos -= new Vector3(100, 0, 0); break; } } yield return(new WaitForSeconds(0.1f)); index = m_shot.StartEuler(bullet, bullets, 10, 120, 40, 0.2f); yield return(new WaitForSeconds(5.0f)); m_shot.StopCoroutineWithIndex(index); yield return(new WaitForSeconds(0.1f)); while (true) { m_Transform.position -= new Vector3(1.0f, 00f, 0.0f); yield return(new WaitForSeconds(0.01f)); if (pos == m_Transform.position) { break; } } yield return(new WaitForSeconds(0.1f)); GameObject.Destroy(gameObject); }
// 间隔一段时间进行欧拉角射击 private IEnumerator ShotForEuler() { while (true) { yield return(new WaitForSeconds(1.0f)); int index = m_Shot.StartEuler(Bullet_Common, Bullets, BaseNumber * 3, 30, -BaseSpeed, 1.2f); yield return(new WaitForSeconds(3.0f)); m_Shot.StopCoroutineWithIndex(index); } }
private IEnumerator StartEulerShot(float totalTime) { float time = 0.0f; while (time < totalTime) { int index = m_Shot.StartEuler(Bullet_Common, Bullets, BaseNumber * 3, 60, -BaseSpeed, 0.5f); yield return(new WaitForSeconds(2.0f)); m_Shot.StopCoroutineWithIndex(index); time += 2.0f; } }
// 第一个技能 private IEnumerator Skill_1(float totalTime) { float time = 0.0f; int index_1 = m_Shot.StartEuler(bullet_Big, bullets, baseNumber * 3, 60, -60, 2.0f); bool flag = true; while (true) { int index; index = m_Shot.StartCycleLinesWithTimeOffsetAndTrace(bullet_Common, bullets, player_Transform.position, 38 , 10, flag, 100,baseSpeed * 2,0.5f,1.0f); yield return new WaitForSeconds(1.6f); m_Shot.StopCoroutineWithIndex(index); flag = !flag; time += 1.5f; if (time >= totalTime) { break; } } m_Shot.StopCoroutineWithIndex(index_1); }
// 第一个技能方法 private IEnumerator StartTriangleAndCulerShot_1(float totalTime) { float time = 0.0f; int index_1 = m_Shot.StartEuler(bullet_Big, bullets, baseNumber * 2, 60, -60, 2.0f); while (true) { int index; index = m_Shot.StartMoreLineWithTimeOffsetAndTrace(bullet_Common, bullets, player_Transform.position, baseNumber * 3, 20, -baseSpeed, baseSpeed, 0.2f); yield return(new WaitForSeconds(1.0f)); m_Shot.StopCoroutineWithIndex(index); time += 1.0f; if (time >= totalTime) { break; } } m_Shot.StopCoroutineWithIndex(index_1); }