Esempio n. 1
0
    public void LooseRound() {
        GamePlayControls.self.CloseDiamonds();
        GamePlayControls.self.OpenPowerup();
        Game.GameActive = false;

        CanvasGroup roundEndGroup = GamePlayControls.self.RoundEndGroup;
        roundEndGroup.gameObject.SetActive(true);
        roundEndGroup.interactable = true;
        LeanTween.alphaCanvas(roundEndGroup, 1, 0.5f);

        CurrentPowerup = CutoutType.Null;
        RemainingPowerup = 0;
        GamePlayControls.self.PowerupGroup.SetActive(false);

        Game.Score = Mathf.Max(Game.Score, Score);

        FBAppEvents.GameComplete(Score);
    }
    public static void EndGame()
    {
        Debug.Log("EndGame Instance.highScore = " + Instance.highScore + "\nInstance.score = " + Instance.score);

        // Log custom App Event for game completion
        FBAppEvents.GameComplete(Instance.score);

        // Ensure we have read score from FB before we allow overriding the High Score
        if (FB.IsLoggedIn &&
            Instance.highScore.HasValue &&
            Instance.highScore < Instance.score)
        {
            Debug.Log("Player has new high score :" + Instance.score);
            Instance.highScore = Instance.score;

            //Set a flag so MainMenu can handle posting the score once its scene has loaded
            highScorePending = true;
        }

        //Return to main menu
        Application.LoadLevel("MainMenu");
    }