Exemple #1
0
        public void EndGame()
        {
            ShakerLabel.text = ShakerFinal;
            float score = GetScore();

            Debug.Log(score);

            FinalScoreText.text = GetScoreText(score);
            try
            {
                DishPreparationManager preparationManager = FindObjectOfType <DishPreparationManager>();
                GameNarrativeManager   narrativeManager   = FindObjectOfType <GameNarrativeManager>();
                DishScoreManager       scoreManager       = FindObjectOfType <DishScoreManager>();

                Guid           monsterID         = narrativeManager.CurrentStage.MonsterID;
                IngredientType currentIngredient = preparationManager.currentIngredient;
                scoreManager.AddIngredientToDish(monsterID, currentIngredient, score);
            }
            catch (Exception ex)
            {
                Debug.Log(ex.Message);
                Debug.Log("Shaking Scene not Running in Game");
            }

            UIManager.EndGame();
        }
        public void ScoreGame()
        {
            CalculateScore();
            SetScore();

            try
            {
                DishPreparationManager preparationManager = FindObjectOfType <DishPreparationManager>();
                GameNarrativeManager   narrativeManager   = FindObjectOfType <GameNarrativeManager>();
                DishScoreManager       scoreManager       = FindObjectOfType <DishScoreManager>();

                Guid           monsterID         = narrativeManager.CurrentStage.MonsterID;
                IngredientType currentIngredient = preparationManager.currentIngredient;
                scoreManager.AddIngredientToDish(monsterID, currentIngredient, Score);
            }
            catch (Exception ex)
            {
                Debug.Log(ex.Message);
                Debug.Log("Shaking Scene not Running in Game");
            }
        }
        public void EndGame()
        {
            Score = CalculateScore();

            try
            {
                DishPreparationManager preparationManager = FindObjectOfType <DishPreparationManager>();
                GameNarrativeManager   narrativeManager   = FindObjectOfType <GameNarrativeManager>();
                DishScoreManager       scoreManager       = FindObjectOfType <DishScoreManager>();

                Guid           monsterID         = narrativeManager.CurrentStage.MonsterID;
                IngredientType currentIngredient = preparationManager.currentIngredient;
                scoreManager.AddIngredientToDish(monsterID, currentIngredient, Score);
            }
            catch (Exception ex)
            {
                Debug.Log(ex.Message);
                Debug.Log("Grill Scene not Running in Game");
            }

            StartCoroutine(Manager.ShowScore(Score));
        }
Exemple #4
0
        public void SetScore()
        {
            CalculateScore();
            try
            {
                DishPreparationManager preparationManager = FindObjectOfType <DishPreparationManager>();
                GameNarrativeManager   narrativeManager   = FindObjectOfType <GameNarrativeManager>();
                DishScoreManager       scoreManager       = FindObjectOfType <DishScoreManager>();

                Guid           monsterID         = narrativeManager.CurrentStage.MonsterID;
                IngredientType currentIngredient = preparationManager.currentIngredient;
                scoreManager.AddIngredientToDish(monsterID, currentIngredient, Score);
            }
            catch (Exception ex)
            {
                Debug.Log(ex.Message);
                Debug.Log("Microwave Scene not Running in Game");
            }

            int    displayScore   = Mathf.RoundToInt((1f - Score) * 1000f);
            string displayMessage = displayScore.ToString() + "/1000";

            ScoreText.text = displayMessage;
        }
        /// <summary>
        /// Ends this minigame by setting each of the different components to their finished
        /// state.
        /// </summary>
        public void EndGame()
        {
            CalculateScore();

            try
            {
                DishPreparationManager preparationManager = FindObjectOfType <DishPreparationManager>();
                GameNarrativeManager   narrativeManager   = FindObjectOfType <GameNarrativeManager>();
                DishScoreManager       scoreManager       = FindObjectOfType <DishScoreManager>();

                Guid           monsterID         = narrativeManager.CurrentStage.MonsterID;
                IngredientType currentIngredient = preparationManager.currentIngredient;
                scoreManager.AddIngredientToDish(monsterID, currentIngredient, Score);
            }
            catch (Exception ex)
            {
                Debug.Log(ex.Message);
                Debug.Log("Chopping Scene not Running in Game");
            }

            float scaledScore = (1 - Score) * 1000;

            FinalScore.text = Mathf.RoundToInt(scaledScore).ToString() + "/1000";
        }