Пример #1
0
    private void Awake()
    {
        if (!StartScrScript.useEffect)
        {
            postProcessingV2.enabled = false;
        }
        Camera.main.depthTextureMode |= DepthTextureMode.Depth;

        EnemyBurn.InitAliveCnt();

        isGameOver  = false;
        isBossStage = false;
        fc.gameObject.SetActive(true);

        if (InitStatic)
        {
            MoveTranslate.InitStaticPool();
            // MoveTranslate.GP.Allocate(32);

            MoveAddPos.InitStaticPool();
            MoveAddPos.GP.Allocate(512);
            MoveAddPosStop.InitStaticPool();
            MoveAddPosStop.GP.Allocate(32);
            MoveAddPosExt.InitStaticPool();
            MoveAddPosExt.GP.Allocate(32);

            EBul01.InitStaticPool();
            EBul01.GP.Allocate(32);
            EBul02.InitStaticPool();
            EBul02.GP.Allocate(4);
            EBul03.InitStaticPool();
            EBul03.GP.Allocate(32);
            EBul04.InitStaticPool();
            EBul04.GP.Allocate(1);
            EBul05.InitStaticPool();
            EBul05.GP.Allocate(1);
            EBul06.InitStaticPool();
            EBul06.GP.Allocate(1);
            InitStatic = false;
        }

        memSpaceAlloc = new int[8192];
    }
    void Pat2()
    {
        if (currentPointer == 3)
        {
            if (curCnt == 45)
            {
                GameClear();
            }
            if (curCnt > 120)
            {
                GameClear();
                isClear = true;
                GameManager.SetGameOver();
            }
            ++curCnt;
            return;
        }

        const int currentPtrMax = 4;

        if (waitingEnemy + EnemyBurn.AliveCnt <= 0)
        {
            ++currentPointer;

            switch (currentPointer % currentPtrMax)
            {
            case 0: SetPat(2, 7); break;

            case 1: SetPat(2, 128); break;

            case 2: SetPat(2, 31); break;
            }

            curCnt = 0;
        }

        //
        // static Vector3 bossscale = new Vector3(1.5f, 1.5f, 1.5f);

        if (curCnt % curInterval == 0 && waitingEnemy > 0)
        {
            EnemyBurn ene = EnemyManager.gi.GetObject(1) as EnemyBurn;
            // ene.SetModel(1);
            MoveAddPos     mp   = null;
            MoveAddPosStop mp2  = null;
            MoveAddPosExt  mp3  = null;
            EBul03         eb03 = null;
            EBul05         eb05 = null;
            EBul06         eb06 = null;

            // 敵作成 HP1200程度が全力1秒漏れなしショット, 1セット4発で80
            switch (currentPointer % currentPtrMax)
            {
            case 0:
                tmpVec.Set(0f, -8.5f, 0f);
                ene.trans.position = tmpVec;
                ene.Settings(10000, 5, 6, 360);
                mp2 = MoveAddPosStop.GP.GetSleep();
                mp2.Settings(120, 3600);
                mp2.SetSpdDeg(12f * 0.02f, 90f);
                mp2.SetSpd2Deg(2.5f * 0.02f, 90f);
                ene.AddScript(mp2);
                eb05 = EBul05.GP.GetSleep();
                ene.AddScript(eb05);

                for (int i = 0; i < 3; ++i)
                {
                    ene = EnemyManager.gi.GetObject(1) as EnemyBurn;
                    // ene.SetModel(1);
                    tmpVec.Set(-1.75f * i, 8.5f, 0f);
                    ene.trans.position = tmpVec;
                    ene.Settings(600, 3, 3, 360);
                    mp3 = MoveAddPosExt.GP.GetSleep();
                    mp3.Settings(0.95f, 120);
                    mp3.SetSpdDeg(17f * 0.02f, -90);
                    ene.AddScript(mp3);
                    eb03 = EBul03.GP.GetSleep();
                    eb03.Settings(50, 5, 90, 10, 0.4f, 360, 14f);
                    ene.AddScript(eb03);

                    ene = EnemyManager.gi.GetObject(1) as EnemyBurn;
                    // ene.SetModel(1);
                    tmpVec.Set(1.75f * i, 8.5f, 0f);
                    ene.trans.position = tmpVec;
                    ene.Settings(600, 3, 3, 360);
                    mp3 = MoveAddPosExt.GP.GetSleep();
                    mp3.Settings(0.95f, 120);
                    mp3.SetSpdDeg(17f * 0.02f, -90);
                    ene.AddScript(mp3);
                    eb03 = EBul03.GP.GetSleep();
                    eb03.Settings(50, 5, 90, 10, 0.4f, 360, 14f);
                    ene.AddScript(eb03);

                    waitingEnemy -= 2;
                }
                break;

            case 1:
                tmpVec.Set(1f, 8.5f, 0f);
                ene.trans.position = tmpVec;
                ene.Settings(30, 3, 1, 45);
                mp = MoveAddPos.GP.GetSleep();
                mp.SetSpdDeg(30f * 0.02f, -92f);
                ene.AddScript(mp);

                ene = EnemyManager.gi.GetObject(1) as EnemyBurn;
                // ene.SetModel(1);
                tmpVec.Set(-1f, 8.5f, 0f);
                ene.trans.position = tmpVec;
                ene.Settings(30, 3, 1, 45);
                mp = MoveAddPos.GP.GetSleep();
                mp.SetSpdDeg(30f * 0.02f, -88f);
                ene.AddScript(mp);

                --waitingEnemy;
                break;

            case 2:
                tmpVec.Set(0f, -8.5f, 0f);
                ene.trans.position = tmpVec;
                ene.Settings(8000, 5, 6, 360);
                mp2 = MoveAddPosStop.GP.GetSleep();
                mp2.Settings(120, 3600);
                mp2.SetSpdDeg(12f * 0.02f, 90f);
                mp2.SetSpd2Deg(2.5f * 0.02f, 90f);
                ene.AddScript(mp2);
                eb06 = EBul06.GP.GetSleep();
                ene.AddScript(eb06);

                for (int i = 0; i < 5; ++i)
                {
                    ene = EnemyManager.gi.GetObject(1) as EnemyBurn;
                    // ene.SetModel(1);
                    tmpVec.Set(-1.75f * i, 8.5f, 0f);
                    ene.trans.position = tmpVec;
                    ene.Settings(800, 3, 3, 360);
                    mp3 = MoveAddPosExt.GP.GetSleep();
                    mp3.Settings(0.95f, 120);
                    mp3.SetSpdDeg(17f * 0.02f, -90);
                    ene.AddScript(mp3);
                    eb03 = EBul03.GP.GetSleep();
                    eb03.Settings(50, 3, 120, 10, 0.4f, 360, 14f);
                    ene.AddScript(eb03);

                    ene = EnemyManager.gi.GetObject(1) as EnemyBurn;
                    // ene.SetModel(1);
                    tmpVec.Set(1.75f * i, 8.5f, 0f);
                    ene.trans.position = tmpVec;
                    ene.Settings(800, 3, 3, 360);
                    mp3 = MoveAddPosExt.GP.GetSleep();
                    mp3.Settings(0.95f, 120);
                    mp3.SetSpdDeg(17f * 0.02f, -90);
                    ene.AddScript(mp3);
                    eb03 = EBul03.GP.GetSleep();
                    eb03.Settings(50, 3, 120, 10, 0.4f, 360, 14f);
                    ene.AddScript(eb03);

                    waitingEnemy -= 2;
                }

                for (int i = 0; i < 5; ++i)
                {
                    ene = EnemyManager.gi.GetObject(1) as EnemyBurn;
                    //  ene.SetModel(1);
                    tmpVec.Set(-1.75f * i, 8.5f, 0f);
                    ene.trans.position = tmpVec;
                    ene.Settings(600, 3, 3, 360);
                    mp3 = MoveAddPosExt.GP.GetSleep();
                    mp3.Settings(0.95f, 120);
                    mp3.SetSpdDeg(25f * 0.02f, -90);
                    ene.AddScript(mp3);
                    eb03 = EBul03.GP.GetSleep();
                    eb03.Settings(50, 3, 120, 10, 0.4f, 360, 14f);
                    ene.AddScript(eb03);

                    ene = EnemyManager.gi.GetObject(1) as EnemyBurn;
                    // ene.SetModel(1);
                    tmpVec.Set(1.75f * i, 8.5f, 0f);
                    ene.trans.position = tmpVec;
                    ene.Settings(600, 3, 3, 360);
                    mp3 = MoveAddPosExt.GP.GetSleep();
                    mp3.Settings(0.95f, 120);
                    mp3.SetSpdDeg(25f * 0.02f, -90);
                    ene.AddScript(mp3);
                    eb03 = EBul03.GP.GetSleep();
                    eb03.Settings(50, 3, 120, 10, 0.4f, 360, 14f);
                    ene.AddScript(eb03);

                    waitingEnemy -= 2;
                }

                for (int i = 0; i < 5; ++i)
                {
                    ene = EnemyManager.gi.GetObject(1) as EnemyBurn;
                    // ene.SetModel(1);
                    tmpVec.Set(-1.75f * i, 8.5f, 0f);
                    ene.trans.position = tmpVec;
                    ene.Settings(400, 3, 3, 360);
                    mp3 = MoveAddPosExt.GP.GetSleep();
                    mp3.Settings(0.95f, 120);
                    mp3.SetSpdDeg(32f * 0.02f, -90);
                    ene.AddScript(mp3);
                    eb03 = EBul03.GP.GetSleep();
                    eb03.Settings(50, 3, 120, 10, 0.4f, 360, 14f);
                    ene.AddScript(eb03);

                    ene = EnemyManager.gi.GetObject(1) as EnemyBurn;
                    // ene.SetModel(1);
                    tmpVec.Set(1.75f * i, 8.5f, 0f);
                    ene.trans.position = tmpVec;
                    ene.Settings(400, 3, 3, 360);
                    mp3 = MoveAddPosExt.GP.GetSleep();
                    mp3.Settings(0.95f, 120);
                    mp3.SetSpdDeg(32f * 0.02f, -90);
                    ene.AddScript(mp3);
                    eb03 = EBul03.GP.GetSleep();
                    eb03.Settings(50, 3, 120, 10, 0.4f, 360, 14f);
                    ene.AddScript(eb03);

                    waitingEnemy -= 2;
                }
                break;
            }

            --waitingEnemy;
        }

        ++curCnt;
    }