Exemple #1
0
    // 间隔一段时间进行线性追踪射击
    private IEnumerator ShotForLine()
    {
        while (true)
        {
            yield return(new WaitForSeconds(1.0f));

            int index = m_Shot.StartMoreLineWithTimeOffsetAndTrace(Bullet_Common, Bullets, playerTrasform.position,
                                                                   BaseNumber * 3, 30, -BaseSpeed / 2, BaseSpeed, 1.2f);
            yield return(new WaitForSeconds(3.0f));

            m_Shot.StopCoroutineWithIndex(index);
        }
    }
Exemple #2
0
    private IEnumerator StartCycleMoveAndShot(float totalTime)
    {
        float time = 0.0f;

        while (time < totalTime)
        {
            int index = m_Shot.StartCycleWithTimeOffsetAndTrace(Bullet_Common, Bullets, playerTrasform.position,
                                                                BaseNumber * 3, BaseSpeed, BaseSpeed * 2, 0.8f, 0.5f);
            yield return(new WaitForSeconds(2.0f));

            m_Shot.StopCoroutineWithIndex(index);
            time += 2.0f;
        }
    }
Exemple #3
0
    // 行为!
    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);
    }
Exemple #4
0
    private IEnumerator SkillShip_2(GameObject obj, float shotTime)
    {
        BulletShotHelper m_shot = obj.GetComponent <BulletShotHelper>();
        int index = m_shot.StartMoreRotationLines(bullet, bullets, 12, 20, 50, 0.1f);

        yield return(new WaitForSeconds(shotTime));

        m_shot.StopCoroutineWithIndex(index);
    }
Exemple #5
0
    private IEnumerator SkillShip_4(GameObject obj, float shotTime)
    {
        BulletShotHelper m_shot        = obj.GetComponent <BulletShotHelper>();
        ShipControl      m_ShipControl = obj.GetComponent <ShipControl>();

        m_ShipControl.NotDieStateStart();
        int index   = m_shot.StartCycleBoom(bullet, bullet, bullets, 12, 12, 100, 60, 0.1f, 0.5f);
        int index_2 = m_shot.StartRotationLines(bullet_other, bullets, 12, 10, 100, 0.1f);

        yield return(new WaitForSeconds(shotTime));

        m_shot.StopCoroutineWithIndex(index);
        m_shot.StopCoroutineWithIndex(index_2);
        if (PlayerPrefs.GetInt("NotDie") == 0)
        {
            m_ShipControl.NotDieStateEnd();
        }
    }
Exemple #6
0
 // 第一个技能
 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);
 }
Exemple #7
0
    // 第一个技能方法
    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);
    }
Exemple #8
0
    private IEnumerator SkillShip_3(GameObject obj, float shotTime)
    {
        BulletShotHelper m_shot        = obj.GetComponent <BulletShotHelper>();
        ShipControl      m_ShipControl = obj.GetComponent <ShipControl>();

        m_ShipControl.NotDieStateStart();
        int index = m_shot.StartCycleLines(bullet, bullets, 12, 10, false, 80, 0.1f);


        //m_shot.StartMoreLineWithTimeOffsetAndTrace(bullet, bullets, new Vector3(50, 0, 260), 3, 20, 30, 50, 0.1f, 0.5f);



        //int index = m_shot.StartCycleLinesWithTimeOffsetAndTrace(bullet, bullets, new Vector3(50, 0, 260f),
        //    38, 10, false, 30, 100, 0.1f, 1.0f);

        yield return(new WaitForSeconds(shotTime));

        m_shot.StopCoroutineWithIndex(index);
        if (PlayerPrefs.GetInt("NotDie") == 0)
        {
            m_ShipControl.NotDieStateEnd();
        }
    }
Exemple #9
0
 // 停止默认射击
 private void StopDefaultShot()
 {
     shotDefault = false;
     m_Shot.StopCoroutineWithIndex(shotIndex);
 }