Example #1
0
    //vine shoot
    private IEnumerator Vine_Shoot_Cor(VineList VList, int divide_Count)
    {
        if (VList.list.Count == 0)
        {
            VList.Create_List(bullet_Num, transform.position, Mathf.PI, Random.Range(-0.05f, 0.05f));
        }
        //エフェクト
        Play_Divide_Effect(VList.list[0]);
        yield return(new WaitForSeconds(0.5f));

        int count = 1;

        foreach (Vector2 pos in VList.list)
        {
            Generate_Vine_Bullet(pos);
            //画面外に出たら終わる
            if (Mathf.Abs(pos.x) > 250f || Mathf.Abs(pos.y) > 140f)
            {
                yield break;
            }
            //枝分かれを作る
            if (count % divide_Count == 0)
            {
                divide_Count += 3;
                count         = 0;
                VineList v             = new VineList();
                float    initial_Angle = VList.Angle() + (Random.Range(0, 2) - 0.5f) * Mathf.PI;
                v.Create_List(bullet_Num, pos, initial_Angle, Random.Range(-0.1f, 0.1f));
                StartCoroutine(Vine_Shoot_Cor(v, divide_Count));
            }
            count++;
            yield return(new WaitForSeconds(shoot_Span));
        }
    }
Example #2
0
    public void Shoot_Vine_Shoot(int divide_Count)
    {
        VineList VList = new VineList();

        VList.Create_List(bullet_Num, transform.position, Mathf.PI, 0);
        StartCoroutine(Vine_Shoot_Cor(VList, divide_Count));
    }