コード例 #1
0
 public void FadeOut()
 {
     if (hMusic)
     {
         music.FadeOut(0);
     }
     screenFade = SCR_gui.CreateScreenCover(1);
 }
コード例 #2
0
ファイル: SCR_stage.cs プロジェクト: balatimuz/cos
    void UpdateState()
    {
        stateCounter += Time.deltaTime;

        //INTRO
        if (state == 10)
        {
            if (stateCounter >= 0.5f)
            {
                CreateCountDown(0);
                StateNext();
            }
        }
        if (state == 11)
        {
            if (stateCounter >= 1f)
            {
                CreateCountDown(1);
                StateNext();
            }
        }
        if (state == 12)
        {
            if (stateCounter >= 1f)
            {
                cam.InitiateStage(1);
                CreateCountDown(2);
                StateNext();
            }
        }
        if (state == 13)
        {
            if (stateCounter >= 1f)
            {
                CreateCountDown(3);
                pauseAllowed = true;
                SCR_input.playerControlActive = true;
                SCR_enemySpawner.spawnOn      = true;
                player.GetComponent <SCR_characterControl>().ReticleOn(true);

                StateNext();
            }
        }
        if (state == 14)
        {
            if (stateCounter >= 1f)
            {
                ShowHUD(true);
                SetState(0);
            }
        }

        //FAIL
        if (state == 20)
        {
            if (stateCounter >= 0.6f)
            {
                SCR_gui.CreateIcon("GameOver", Vector3.zero);

                if (SCR_main.hMusic)
                {
                    music.FadeOut(1);
                }

                StateNext();
            }
        }

        if (state == 21)
        {
            if (stateCounter >= 0.3f)
            {
                if (SCR_main.hCursor)
                {
                    Cursor.visible = true;
                }

                optionPos = stageFinishOptionPos;
                SCR_gui.CreateOption("StageFailRetry", optionPos);
                optionPos += SCR_gui.optionSpacing;
                SCR_gui.CreateOption("StageFailExit", optionPos);
                SetState(0);
            }
        }


        //SUCCESS
        if (state == 30)
        {
            if (stateCounter >= 1f)
            {
                SCR_input.playerControlActive = false;
                player.GetComponent <SCR_characterControl>().ReticleOn(false);

                player.AttackCancel();
                player.speed[1] = Vector3.zero;
                player.PlayAnim(0);

                if (SCR_main.hMusic)
                {
                    music.FadeOut(1);
                }

                StateNext();
            }
        }

        if (state == 31)
        {
            if (stateCounter >= 0.3f)
            {
                startTimer = false;
                SCR_gui.CreateIcon("StageComplete", Vector3.zero);
                StateNext();
            }
        }

        if (state == 32)
        {
            if (stateCounter >= 0.2f)
            {
                if (SCR_main.hCursor)
                {
                    Cursor.visible = true;
                }

                optionPos = stageFinishOptionPos;
                SCR_gui.CreateOption("StageCompleteContinue", optionPos);
                optionPos += SCR_gui.optionSpacing;
                SCR_gui.CreateOption("StageCompleteExit", optionPos);
                SetState(0);
            }
        }
    }