コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        if (effectReady)
        {
            //Apply concentration levels to effect
            bool allGood = true;
            for (int i = 0; i < 4; i++)
            {
                if (effectArray[i].activeSelf)
                {
                    switch (effectArray[i].GetType().ToString())
                    {
                    case "BlurEffect":
                        be.applyConcentration(gc.playerConcentration[i]);
                        break;

                    case "CameraShake":
                        cs.applyConcentration(gc.playerConcentration[i]);
                        break;

                    case "FadeEffect":
                        fe.applyConcentration(gc.playerConcentration[i]);
                        break;

                    case "TwirlEffect":
                        te.applyConcentration(gc.playerConcentration[i]);
                        break;
                    }
                    ;

                    if (gc.playerConcentration[i] != 1.0f)
                    {
                        allGood = false;
                    }
                }
            }
            if (allGood)
            {
                float elapsed = gt.stop();
                gc.levelTime[lvl - 1] = elapsed;
                gc.startLevel(nextlvl);
            }
        }
    }