Esempio n. 1
0
    public void setScoreDetails()
    {
        string path = Application.persistentDataPath + "/JigsawPuzzle.xml";

        puz = gameController.GetComponent <JigsawPuzzle> ();
        if (puz.gameLevel == 2)
        {
            LevelDataUpdate.UpdateEasy(finalScore, time, path);
        }

        if (puz.gameLevel == 3)
        {
            LevelDataUpdate.UpdateNormal(finalScore, time, path);
        }

        if (puz.gameLevel == 4)
        {
            LevelDataUpdate.UpdateHard(finalScore, time, path);
        }


        correct_guess_count.text = correctGuesses.ToString();
        wrong_guess_count.text   = wrongGuesses.ToString();
        total_guess_count.text   = totalGuesses.ToString();
        correct_guess_score.text = (50 * correctGuesses).ToString("+#;-#;0");
        wrong_guess_score.text   = score_wrong.ToString("+#;-#;0");
        time_used.text           = timeused_in_String;
        total_score.text         = finalScore.ToString();
        bonus1.text = score_time.ToString("+#;-#;0");
        bonus2.text = bonus_acc.ToString("+#;-#;0");
    }
Esempio n. 2
0
    //FB SDK END


    public void prepareResultTable()
    {
        TotalGuess_Text.text   = TotalGuess.ToString();
        CorrectGuess_Text.text = CorrectGuess.ToString();
        WrongGuess_Text.text   = WrongGuess.ToString();

        int minutes = (int)Time / 60;
        int seconds = (int)Time % 60;

        TimeUsed_Text.text = string.Format("{0:00} : {1:00}", minutes, seconds);

        int BasicScore = 50 * CorrectGuess + (-10) * WrongGuess;

        BasicScore_Text.text = BasicScore.ToString();

        int Bonus_Correct;

        if (TotalGuess == CorrectGuess && WrongGuess == 0)
        {
            Bonus_Correct           = 50;
            Bonus_Correct_Text.text = "50";
        }
        else
        {
            Bonus_Correct           = 0;
            Bonus_Correct_Text.text = "0";
        }

        int Bonus_Time;

        if (NUMBER_OF_PUZZLE == 4 && Time < 31)
        {
            Bonus_Time           = 50;
            Bonus_Time_Text.text = "50";
        }
        else if (NUMBER_OF_PUZZLE == 9 && Time < 61)
        {
            Bonus_Time           = 50;
            Bonus_Time_Text.text = "50";
        }
        else if (NUMBER_OF_PUZZLE == 16 && Time < 121)
        {
            Bonus_Time           = 50;
            Bonus_Time_Text.text = "50";
        }
        else
        {
            Bonus_Time           = 0;
            Bonus_Time_Text.text = "0";
        }

        if (NUMBER_OF_PUZZLE == 4)
        {
            Bonus_Time_Description.text = "If you can finish within 30 seconds";
        }
        else if (NUMBER_OF_PUZZLE == 9)
        {
            Bonus_Time_Description.text = "If you can finish within 1 minute";
        }
        else if (NUMBER_OF_PUZZLE == 16)
        {
            Bonus_Time_Description.text = "If you can finish within 2 minutes";
        }



        finalScore = BasicScore + Bonus_Correct + Bonus_Time;
        if (finalScore < 0)
        {
            finalScore = 0;
        }
        FinalScore_Text.text = (finalScore).ToString();

        ResultTable.SetActive(true);


        string path = Application.persistentDataPath + "/GuessingPuzzle.xml";

        // Update XML file
        if (NUMBER_OF_PUZZLE == 4)
        {
            LevelDataUpdate.UpdateEasy(finalScore, Time, path);
        }
        else if (NUMBER_OF_PUZZLE == 9)
        {
            LevelDataUpdate.UpdateNormal(finalScore, Time, path);
        }
        else if (NUMBER_OF_PUZZLE == 16)
        {
            LevelDataUpdate.UpdateHard(finalScore, Time, path);
        }
    }