コード例 #1
0
    //restarts the current level
    void RestartLevel()
    {
        Time.timeScale = 1; //LETHAL FORCES

        if (!restartInProgress)
        {
            restartInProgress = true;

            //sfx
            GlobalAudioPlayer.PlaySFX("ButtonStart");

            //button flicker
            ButtonFlicker bf = GetComponentInChildren <ButtonFlicker>();
            if (bf != null)
            {
                bf.StartButtonFlicker();
            }

            //fade out
            fader.Fade(UIFader.FADE.FadeOut, 0.5f, 0.5f);

            //reload level
            Invoke("RestartScene", 1f);
        }
    }
コード例 #2
0
    //restarts the current level
    void RestartLevel()
    {
        if (!restartInProgress)
        {
            restartInProgress = true;
            GlobalAudioPlayer.PlaySFX("ButtonStart");

            //button flicker
            ButtonFlicker bf = GetComponentInChildren <ButtonFlicker>();
            if (bf != null)
            {
                bf.StartButtonFlicker();
            }

            Invoke("RestartScene", 1f);
        }
    }
コード例 #3
0
    /// <summary>
    /// 重打当前关卡
    /// </summary>
    void RestartLevel()
    {
        if (!restartInProgress)
        {
            restartInProgress = true;

            //播放音效
            GlobalAudioPlayer.PlaySFX("ButtonStart");

            ButtonFlicker bf = GetComponentInChildren <ButtonFlicker>();
            if (bf != null)
            {
                bf.StartButtonFlicker();
            }

            fader.Fade(UIFader.FADE.FadeOut, 0.5f, 0.5f);

            Invoke("RestartScene", 1f);
        }
    }
コード例 #4
0
    //restarts the current level
    void LoadLevel(string sceneName, int levelId)
    {
        if (!restartInProgress)
        {
            restartInProgress = true;

            //sfx
            GlobalAudioPlayer.PlaySFX("ButtonStart");

            //button flicker
            ButtonFlicker bf = GetComponentInChildren <ButtonFlicker>();
            if (bf != null)
            {
                bf.StartButtonFlicker();
            }

            //load scene
            GlobalGameSettings.currentLevelId = levelId;
            LoadScene(sceneName);
        }
    }
コード例 #5
0
    public void StartGame()
    {
        if (!startGameInProgress)
        {
            startGameInProgress = true;

            //play sfx
            GlobalAudioPlayer.PlaySFX("ButtonStart");

            //flicker button
            ButtonFlicker bf = GetComponentInChildren <ButtonFlicker>();
            if (bf != null)
            {
                bf.StartButtonFlicker();
            }

            //fade out
            FadeOut();

            //start Game
            Invoke("startGame", 1.8f);
        }
    }