예제 #1
0
    void TestPause()
    {
        if (menu_Ctrl == null)
        {
            menu_Ctrl = gameObject.GetComponent <menu_ctrl>();
        }

        if ((!pausePressButtonOld && UnityEngine.Input.GetKey(KeyCode.Pause)) || (pause && menu_Ctrl != null && menu_Ctrl.menu.active))
        {
            pausePressButtonOld = true;

            if (!pause && !GameOver)
            {
                pause          = true;
                Time.timeScale = 0;
                if (source != null)
                {
                    source.Pause();
                }
            }
            else
            {
                pause          = false;
                Time.timeScale = 1;
                if (source != null)
                {
                    source.UnPause();
                }
            }
        }
        else if (!UnityEngine.Input.GetKey(KeyCode.Pause))
        {
            pausePressButtonOld = false;
        }

        if (PauseWindow != null)
        {
            if (!PauseWindow.active && pause)
            {
                PauseWindow.SetActive(true);
            }
            else if (PauseWindow.active && !pause)
            {
                PauseWindow.SetActive(false);
            }
        }
    }
예제 #2
0
    void test_gameover()
    {
        //Открываем меню только после того как надпись гейм овер высветится полностью
        if (GameOver)
        {
            if (!GameOverSend && !CheatsFound)
            {
                GameOverSend = true;
                //Запихиваем результат в таблицу
                asuncFuncSteam asuncSteam  = GameObject.FindGameObjectWithTag("steam_manager").GetComponent <asuncFuncSteam>();
                bool           NeedReWrite = false;
                if (Input.GetKey(KeyCode.LeftAlt) && Input.GetKey(KeyCode.RightAlt))
                {
                    NeedReWrite = true;
                }

                asuncSteam.UploadScoreInLeaderboard((int)CoofST, NeedReWrite);
                if (scoreTab != null)
                {
                    scoreTab.TimeUpdate = 999;
                }
            }

            start_menu_song();
            if (player.ScoreALL <= 0 && GameOverTime <= 0)
            {
                achievement.zero_score();
            }
            GameOverTime += Time.deltaTime;

            menu_Ctrl = gameObject.GetComponent <menu_ctrl>();
            if (GameOverTime > 4 && !menu_Ctrl.menu.active)
            {
                menu_Ctrl.OpenStaticticsTab();
            }
        }
    }