Example #1
0
    void EndGame()
    {
        // game is over


        // repurpose the timer to display a message to the player



        // reduce the pitch of the background music, if it is set
        //if (musicAudioSource)
        //	musicAudioSource.pitch = 0.5f; // slow down the music


        GameObject.Find("Canvas").SetActive(false);

        TherapySessionObject objTherapy = GameObject.Find("TherapySession").GetComponent <TherapySessionObject> ();

        objTherapy.fillLastSession(score, currentReps, (int)totalTime, level.ToString());
        objTherapy.saveLastGameSession();

        objTherapy.savePerformance((int)bestTotalLeftShoulderAngle, "4");
        objTherapy.savePerformance((int)bestTotalRightShoulderAngle, "5");

        int finalScore = (int)(((double)score / currentReps) * 100.0f);

        canvasScoreText.GetComponentInChildren <TextMesh>().text      = finalScore + "%";
        canvasBestScoreText.GetComponentInChildren <TextMesh> ().text = objTherapy.getGameRecord() + "%";


        if (finalScore <= 60)
        {
            resultMessage.GetComponent <TextMesh>().text = "¡Muy bien!";
            bronzeTrophy.SetActive(true);
        }
        else if (finalScore <= 90)
        {
            resultMessage.GetComponent <TextMesh>().text = "¡Grandioso!";
            bronzeTrophy.SetActive(false);
            silverTrophy.SetActive(true);
        }
        else if (finalScore <= 100)
        {
            resultMessage.GetComponent <TextMesh>().text = "¡Increíble!";
            bronzeTrophy.SetActive(false);
            goldTrophy.SetActive(true);
        }

        canvasResults.SetActive(true);
    }
Example #2
0
    private void saveData()
    {
        GameObject tre = GameObject.Find("TherapySession");

        if (tre != null)
        {
            TherapySessionObject objTherapy = tre.GetComponent <TherapySessionObject> ();

            if (objTherapy != null)
            {
                objTherapy.fillLastSession(score_script.score_obtain, score_script.score_max, (int)0, "1");
                objTherapy.saveLastGameSession();

                objTherapy.savePerformance((int)HoldParametersGreatJourney.best_angle_left, "14");
            }
        }



//		TherapySessionObject objTherapy = GameObject.Find ("TherapySession").GetComponent<TherapySessionObject> ();
//		objTherapy.fillLastSession(score, currentReps, (int)totalTime, level.ToString());
//		objTherapy.saveLastGameSession ();
//
//		objTherapy.savePerformance((int)bestTotalLeftShoulderAngle, "4");
//		objTherapy.savePerformance((int)bestTotalRightShoulderAngle, "5");
    }
Example #3
0
    public void guardarDatos()
    {
        string movimiento;

        if (rodilla == true && pie == true)
        {
            movimiento = "rodilla y pie";
        }
        else if (rodilla == true)
        {
            movimiento = "rodilla";
        }
        else
        {
            movimiento = "pie";
        }
        GameObject tre = GameObject.Find("TherapySession");

        if (tre != null)
        {
            TherapySessionObject objTherapy = tre.GetComponent <TherapySessionObject>();

            if (objTherapy != null)
            {
                objTherapy.fillLastSession(puntos, repeticionesTotales, (int)valorPlay, "1");
                objTherapy.saveLastGameSession();



                objTherapy.savePerformance((int)anguloMin, movimiento);
            }
        }
    }
    private void saveData()
    {
        GameObject tre = GameObject.Find("TherapySession");

        if (tre != null)
        {
            TherapySessionObject objTherapy = tre.GetComponent <TherapySessionObject>();

            if (objTherapy != null)
            {
                objTherapy.fillLastSession(score_script.score_obtain, score_script.score_max, (int)0, "1");
                objTherapy.saveLastGameSession();

                objTherapy.savePerformance((int)HoldParametersVecinosInvasores.best_score, "33");
            }
        }
    }
    public void SaveAndShowResults()
    {
        TherapySessionObject objTherapy = TherapySessionObject.tso;

        if (objTherapy != null)
        {
            objTherapy.fillLastSession(score, totalRepetitions, (int)totalTime, level.ToString());
            objTherapy.saveLastGameSession();

            objTherapy.savePerformance((int)kickScript.BestLeftHipFrontAngle, "4");
            objTherapy.savePerformance((int)kickScript.BestRightHipFrontAngle, "5");
        }
        string         idMinigame = "5";
        GameSessionDAO gameDao    = new GameSessionDAO();
        int            finalScore;

        if (totalRepetitions > 0)
        {
            finalScore = (int)(((float)score / totalRepetitions) * 100.0f);
        }
        else
        {
            finalScore = 0;
        }
        resultsScoreText.text = "Desempeño: " + finalScore + "%";

        float totalRepFloat = (float)totalRepetitions;
        ParametersScreenManagerTiroLibre pmTiroLibre = new ParametersScreenManagerTiroLibre();

        pmTiroLibre.SendGame(finalScore, totalRepFloat, totalTime, score, idMinigame);
        if (useFrontPlane == true)
        {
            PerformanceController performanceCtrl = new PerformanceController();
            performanceCtrl.addPerformance((int)this.FrontAngle1, "36");
            performanceCtrl.addPerformance((int)this.FrontAngle2, "37");
            performanceCtrl.addPerformance((int)this.FrontAngle3, "38");
        }
        if (useBackPlane == true)
        {
            PerformanceController performanceCtrl = new PerformanceController();
            performanceCtrl.addPerformance((int)this.BackAngle1, "33");
            performanceCtrl.addPerformance((int)this.BackAngle2, "34");
            performanceCtrl.addPerformance((int)this.BackAngle3, "35");
        }

        if (objTherapy != null)
        {
            resultsBestScoreText.text = "Mejor: " + objTherapy.getGameRecord() + "%";
        }
        else
        {
            resultsBestScoreText.text = "Mejor:" + gameDao.GetScore(idMinigame) + "%";
        }

        if (finalScore <= 60)
        {
            //resultMessage.GetComponent<TextMesh>().text = "¡Muy bien!";
            star1.sprite = starOn;
            star2.sprite = starOff;
            star3.sprite = starOff;
        }
        else if (finalScore <= 90)
        {
            //resultMessage.GetComponent<TextMesh>().text = "¡Grandioso!";
            star1.sprite = starOn;
            star2.sprite = starOn;
            star3.sprite = starOff;
        }
        else if (finalScore <= 100)
        {
            //resultMessage.GetComponent<TextMesh>().text = "¡Increíble!";
            star1.sprite = starOn;
            star2.sprite = starOn;
            star3.sprite = starOn;
        }

        resultsPanel.SetActive(true);


        //playlist block
        if (PlaylistManager.pm != null && PlaylistManager.pm.active)
        {
            PlaylistManager.pm.NextGame();
        }
    }