void Awake()
 {
     retryButton.onClick.AddListener(OnRetryButtonClick);
     nextButton.onClick.AddListener(OnNextButtonClick);
     menuButton.onClick.AddListener(OnMenuButtonClick);
     GameOverPanel.SetActive(false);
 }
    private void ShowGameOver(int finalScore)
    {
        gameOverPanelObject.SetActive(true);
        GameOverPanel gameOverPanel = gameOverPanelObject.GetComponent <GameOverPanel>();

        gameOverPanel.SetScore(finalScore);
    }
Exemple #3
0
 public void ShowMenu()
 {
     MainMenuPanel.SetActive(true);
     ControlsPanel.SetActive(false);
     VictoryPanel.SetActive(false);
     GameOverPanel.SetActive(false);
 }
 private void ShowWin()
 {
     GameOverPanel.SetActive(true);
     winText.SetActive(true);
     loseText.SetActive(false);
     retryButton.gameObject.SetActive(false);
 }
Exemple #5
0
 public void GameOver(bool failed, string des)
 {
     Debug.Log($"GameOver!! failed = {failed}, {des}");
     IsGameOver = true;
     EventManager.TriggerEvent(GameEvent.GameOver);
     GameOverPanel.Show(failed, des);
 }
    public static void GameOver()
    {
        GameOverPanel gameOverPanel = FindObjectOfType <GameOverPanel>(includeInactive: true);

        gameOverPanel.gameObject.SetActive(true);
        SoundManager.PlayMenuMusic();
    }
Exemple #7
0
 public void Resume()
 {
     GamePanel.SetActive(true);
     PausePanel.SetActive(false);
     GameOverPanel.SetActive(false);
     TimeScaleChange(1);
 }
        public void WaitForMainMenuClick(Action pOnMainMenuClicked)
        {
            GameOverPanel gameOverPanel = gameOverPanelObject.GetComponent <GameOverPanel>();

            gameOverPanel.OnMainMenuButtonClicked -= pOnMainMenuClicked;
            gameOverPanel.OnMainMenuButtonClicked += pOnMainMenuClicked;
        }
Exemple #9
0
 private void GameOver()
 {
     showAd = true;
     GameOverPanel.SetActive(true);
     powerPanel.SetActive(false);
     ProtectedPrefs.SetInt("Coins", lcoin + coin);
     goCoin.text  = "Coins: " + coin.ToString();
     goScore.text = "Score: " + Controller.Distance.ToString("f0") + "0";
     if (Controller.Distance > ProtectedPrefs.GetFloat("HighScore"))
     {
         ProtectedPrefs.SetFloat("HighScore", Controller.Distance);
     }
     if (ProtectedPrefs.HasKey("HighScore"))
     {
         goBScore.text = "Best Score: " + ProtectedPrefs.GetFloat("HighScore").ToString("f0") + "0";
     }
     else
     {
         goBScore.text = "Best Score: " + Controller.Distance.ToString("f0") + "0";
     }
     if (FB.IsLoggedIn)
     {
         #if !UNITY_EDITOR
         StartCoroutine(Facebook.Unity.FBManager.SetScore());
         #endif
     }
 }
Exemple #10
0
    void Update()
    {
        Scoremater.GetComponent <Text>().text = "Score : " + Score.ToString();

        if (Score >= 15)
        {
            medal(1);
        }

        if (Score >= 30)
        {
            medal(2);
        }

        if (Score >= 50)
        {
            medal(3);
        }

        if (GameOver)
        {
            if (PlayerPrefs.GetInt("HS") < Score)
            {
                PlayerPrefs.SetInt("HS", Score);
            }

            int hs = PlayerPrefs.GetInt("HS");
            HighScore.text  = "High Score\n" + hs.ToString();
            ScoreFinal.text = "Score\n" + Score.ToString();
            InGamePanel.SetActive(false);
            GameOverPanel.SetActive(true);
        }
    }
Exemple #11
0
 private void waveLost()
 {
     //PlayerLost = true;
     Time.timeScale = 0;
     Advertisement.Show(NormalVideoID);
     GameOverPanel.SetActive(true);
 }
Exemple #12
0
 public void GameOver(int coins, int score)
 {
     GameOverPanel.SetActive(true);
     finalCoins.text = coins.ToString();
     finalScore.text = score.ToString();
     Invoke("GameOverCoroutine", 2f);
 }
    public void showGameOverPanel()
    {
        if (MainAudioSource.isPlaying && MainAudioSource.clip != bgGameOverClip)
        {
            MainAudioSource.Stop();
            audioSource.PlayOneShot(gameoverClip);
            MainAudioSource.clip = bgGameOverClip;
            MainAudioSource.Play();
        }

        //MainAudioSource.clip = backgroundGameOver;
        GameOverPanel.SetActive(true);
        textScoreLast.text = score.ToString();

        if (score > highscore)
        {
            highscore = score;
        }

        textScoreBest.text = highscore.ToString();

        PlayerPrefs.SetInt("highscore", highscore);

        pauseButton.SetActive(false);
        continueButton.SetActive(false);
        textCurrentScore.enabled = false;
        ScorePanel.SetActive(false);
    }
Exemple #14
0
 public void GameOverShowPanel(int finalScore, int finalCoinScore)
 {
     GameOverPanel.SetActive(true);
     GameOverCoinText.text  = "x" + finalCoinScore;
     GameOverScoreText.text = "x" + finalScore;
     StartCoroutine(GameOverLoadMainMenu());
 }
 /// <summary>
 /// Hides the game over screen.
 /// </summary>
 public void HideGameOverScreen()
 {
     PauseBtn.Enabled = true;
     GameOverPanel.Hide();
     GameOverPanel.Enabled             = false;
     saveGameToolStripMenuItem.Enabled = true;
 }
    public void ShowGameOverPanel(EVENT_TYPE EventType, Component Sender, object Param = null)
    {
        GameOverPanel gameOverPanel = Instantiate(this.gameOverPrefab).GetComponent <GameOverPanel>();

        gameOverPanel.transform.SetParent(this.transform, false);
        gameOverPanel.Init();
    }
Exemple #17
0
 public void GameOver()
 {
     gameObject.SetActive(false);
     GameOverPanel.SetActive(true);
     GameController.Instance.state = eState.MENU;
     Console.WriteLine("Gameover menu controller");
 }
Exemple #18
0
    private void Start()
    {
        gameManager   = GetComponent <GameManager>();
        gameOverPanel = GameObject.Find("GameGUI").GetComponentInChildren <GameOverPanel>();

        currentScene = SceneManager.GetActiveScene();
        Debug.Log(currentScene.ToString() + currentScene.buildIndex);
    }
    /// <summary>
    /// GAME OVER
    /// </summary>
    private void TriggerGameOver()
    {
        StopAllCoroutines();
        TimeLeftText.text = "GAME OVER";

        gameState = GameState.GameOver;
        GameOverPanel.SetActive(true);
    }
Exemple #20
0
 void Start()
 {
     instance       = this;
     scoreText.text = "0";
     GameManager.Instance.scoreUpdate.AddListener(OnScoreUpdate);
     MenuPanel.SetActive(true);
     GameOverPanel.SetActive(false);
 }
 void Awake()
 {
     if (instance != null)
     {
         Debug.LogError("More than one GameOverPanel in scene !"); return;
     }
     instance = this;
 }
Exemple #22
0
    public static void DisplayGameOver(string message, bool win)
    {
        BattleManager.Instance.BattleState = BattleStates.GameOver;
        GameOverPanel go = GameObject.Instantiate(Resources.Load <GameObject>("prefabs/GameOver"), GameObject.Find("BattleTransition").transform).GetComponent <GameOverPanel>();

        go.Load(message, win);
        go.ShowResult(win);
    }
Exemple #23
0
    public void GameOverShowPanel(int FinalScore, int FinalCoinScore)
    {
        GameOverPanel.SetActive(true);
        GameOverScoreText.text = FinalScore.ToString();
        GameOverCoinText.text  = FinalCoinScore.ToString();

        StartCoroutine(GameOverLoadMainManu());
    }
Exemple #24
0
    private void SetStats()
    {
        GameOverPanel endScreen = gameOverPanel.gameObject.GetComponent <GameOverPanel>();

        endScreen.SetRoundText("Rounds Completed: " + (boardManagerRef.GetLevel() - 1).ToString());
        endScreen.SetTimeText("Time: " + boardManagerRef.GetEndTime());
        endScreen.SetEnemiesDefeatedText("Enemies Defeated: " + enemyManagerRef.GetEnemiesDefeated().ToString());
    }
 /// <summary>
 /// Displays the game over screen
 /// </summary>
 public void DisplayGameOverScreen()
 {
     PauseBtn.Enabled = false;
     GameOverPanel.Show();
     GameOverPanel.Enabled             = true;
     saveGameToolStripMenuItem.Enabled = false;
     playToolStripMenuItem.Enabled     = false;
     pauseToolStripMenuItem.Enabled    = false;
 }
Exemple #26
0
 private void Reset()
 {
     mainMenuPanel      = FindObjectOfType <MainMenuPanel>();
     gameOverPanel      = FindObjectOfType <GameOverPanel>();
     levelCompletePanel = FindObjectOfType <LevelCompletePanel>();
     fadePanel          = FindObjectOfType <FadePanel>();
     optionsPanel       = FindObjectOfType <OptionsPanel>();
     creditsPanel       = FindObjectOfType <CreditsPanel>();
 }
        public void GameOverScoreTest()
        {
            //To test if the paused is initialised correctly.
            GameObject    gameObj  = new GameObject();
            GameOverPanel gameOver = gameObj.AddComponent <GameOverPanel>();

            int expectedScore = 0;

            Assert.AreEqual(expectedScore, gameOver.Score, "The initial game over score should be 0 because they user haven't started the game or did not score any.");
        }
Exemple #28
0
 void Update()
 {
     if (PlayerPrefs.GetInt("out", 0) == 1)
     {
         Debug.Log("out");
         selectedPlane.SetActive(false);
         GameOverPanel.SetActive(true);
         PlayerPrefs.SetInt("out", 0);
     }
 }
Exemple #29
0
 public void StartGameSettings1()
 {
     //Names
     //gameObject.SetActive(false);
     MainMenuPanel.SetActive(false);
     GameOverPanel.SetActive(false);
     GameSettingsPanel1.SetActive(true);
     GameController.Instance.state = eState.MENU;
     Console.WriteLine("Settings1 menu controller");
 }
Exemple #30
0
 public void StartGameSettings2()
 {
     //Difficulty
     //gameObject.SetActive(false);
     GameOverPanel.SetActive(false);
     GameSettingsPanel1.SetActive(false);
     GameSettingsPanel2.SetActive(true);
     GameController.Instance.state = eState.MENU;
     Console.WriteLine("Settings2 menu controller");
 }
Exemple #31
0
    public static GameOverPanel Instance()
    {
        if (!_modalPanel)
        {
            _modalPanel = FindObjectOfType(typeof (GameOverPanel)) as GameOverPanel;
            if (!_modalPanel)
                Debug.LogError ("There needs to be one active GameOverPanel script on a GameObject in your scene.");
        }

        return _modalPanel;
    }
	void Init(){
		mainPanel =  GameObjectTools.GetComponentInChildren <MainPanel> (gameObject);
		playPanel = GameObjectTools.GetComponentInChildren<PlayPanel> (gameObject);
		pausePanel = GameObjectTools.GetComponentInChildren<PausePanel> (gameObject);
		gameOverPanel = GameObjectTools.GetComponentInChildren<GameOverPanel> (gameObject);

		mainPanel.gameObject.SetActive (true);
		playPanel.gameObject.SetActive (false);
		pausePanel.gameObject.SetActive (false);
		gameOverPanel.gameObject.SetActive (false);

		mainPanel.Init ();
		playPanel.Init ();
		pausePanel.Init ();
		gameOverPanel.Init ();
	}
Exemple #33
0
    // Load the scene and activate the appropriate interface
    public override void OnSceneLoaded()
    {
        Debug.Log("OnSceneLoaded");

        base.OnSceneLoaded ();

        _lettersColorPause = MainActivity.Instance.lettersColorPause;
        _buttonPause = MainActivity.Instance.buttonPause;
        _triggerPause  = MainActivity.Instance.triggerPause;
        _buttonPause.SetActive(true);
        _triggerPause.SetActive(true);

        _digitTopScore = MainActivity.Instance.digitTopScore;
        _digitTopScoreShadow = MainActivity.Instance.digitTopScoreShadow;
        _digitTopScore.SetActive(true);
        _digitTopScoreShadow.SetActive(true);

        _digitScore = MainActivity.Instance.digitScore;
        _digitScoreShadow = MainActivity.Instance.digitScoreShadow;
        _digitScore.SetActive(true);
        _digitScoreShadow.SetActive(true);

        _digitLevel = MainActivity.Instance.digitLevel;
        _digitLevelShadow = MainActivity.Instance.digitLevelShadow;
        _digitLevel.SetActive(true);
        _digitLevelShadow.SetActive(true);

        _digitLines = MainActivity.Instance.digitLines;
        _digitLinesShadow = MainActivity.Instance.digitLinesShadow;
        _digitLines.SetActive(true);
        _digitLinesShadow.SetActive(true);

        _spawn = MainActivity.Instance.spawn;
        _spawn.SetActive(true);

        _pauseManager = MainActivity.Instance.pauseManager;
        _pauseManager.SetActive(true);
        _pausePanel = PausePanel.Instance();

        _gameOverManager = MainActivity.Instance.gameOverManager;
        _gameOverManager.SetActive(true);
        _gameOverPanel = GameOverPanel.Instance();

        _topScoreManager = MainActivity.Instance.topScoreManager;
        _topScoreManager.SetActive(true);
        _topScorePanel = TopScorePanel.Instance();// Top Score Panel

        _cube = MainActivity.Instance.cube;

        /** Audio variable*/
        _boom = MainActivity.Instance.boom;
        _disappearance = MainActivity.Instance.disappearance;
        /** end */

        Start ();
    }