public void SaveAndShowResults() { TherapySessionObject objTherapy = TherapySessionObject.tso; //if (objTherapy != null) //{ // objTherapy.fillLastSession(score, totalRepetitions, (int)totalTime, level.ToString()); // objTherapy.saveLastGameSession(); //} int finalScore; if (totalRepetitions == 0) { finalScore = 0; } else { finalScore = (int)(((float)score / totalRepetitions) * 100.0f); } resultsScoreText.text = "Desempeño: " + finalScore + "%"; if (objTherapy != null) { resultsBestScoreText.text = "Mejor: " + objTherapy.getGameRecord() + "%"; } 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); }
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); }
public void SaveAndShowResults() { TherapySessionObject objTherapy = TherapySessionObject.tso; //if (objTherapy != null) //{ // objTherapy.fillLastSession(score, totalRepetitions, (int)totalTime, level.ToString()); // objTherapy.saveLastGameSession(); //} string idMinigame = "10"; GameSessionDAO gameDao = new GameSessionDAO(); int finalScore; if (totalRepetitions == 0) { finalScore = 0; } else { finalScore = (int)(((float)score / totalRepetitions) * 100.0f); } resultsScoreText.text = "Desempeño: " + finalScore + "%"; if (this.withTime == true) { GameSessionController gameCtrl = new GameSessionController(); gameCtrl.addGameSession(finalScore, 0, this.totalTime, score, idMinigame); } else { GameSessionController gameCtrl = new GameSessionController(); gameCtrl.addGameSession(finalScore, this.totalRepetitions, 0, score, idMinigame); } 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); SendPerformance(); if (PlaylistManager.pm != null && PlaylistManager.pm.active) { PlaylistManager.pm.NextGame(); } }
public void EndGame() { player.SetActive(false); mainPanel.SetActive(false); string idMiniGame = "7"; TherapySessionObject objTherapy = TherapySessionObject.tso; if (objTherapy != null) { //objTherapy.fillLastSession(score, fullScore, (int)totalTime, "0"); //objTherapy.saveLastGameSession(); //objTherapy.savePerformance((int)kickScript.BestLeftHipFrontAngle, "4"); //objTherapy.savePerformance((int)kickScript.BestRightHipFrontAngle, "5"); } GameSessionDAO gameDao = new GameSessionDAO(); int finalScore; if (fullScore > 0) { finalScore = (int)(((float)score / fullScore) * 100.0f); } else { finalScore = 0; } resultsScoreText.text = "Desempeño: " + finalScore + "%"; //int angle = (int)_angleLeft; GameSessionController gameCtrl = new GameSessionController(); PerformanceController performanceCtrl = new PerformanceController(); if (this.withTime == true) { if (JogBool == true && CrouchBool == true && JumpBool == true) { gameCtrl.addGameSession(finalScore, 0, totalTime, score, idMiniGame); performanceCtrl.addPerformance((int)JogThreshold, "16"); performanceCtrl.addPerformance((int)CrouchThreshold, "8"); performanceCtrl.addPerformance((int)JumpThreshold, "7"); } if (JogBool == false && CrouchBool == true && JumpBool == true) { gameCtrl.addGameSession(finalScore, 0, totalTime, score, idMiniGame); performanceCtrl.addPerformance((int)CrouchThreshold, "8"); performanceCtrl.addPerformance((int)JumpThreshold, "7"); } if (JogBool == false && CrouchBool == false && JumpBool == true) { gameCtrl.addGameSession(finalScore, 0, totalTime, score, idMiniGame); performanceCtrl.addPerformance((int)JumpThreshold, "7"); } if (JogBool == false && CrouchBool == true && JumpBool == false) { gameCtrl.addGameSession(finalScore, 0, totalTime, score, idMiniGame); performanceCtrl.addPerformance((int)CrouchThreshold, "8"); } if (JogBool == true && CrouchBool == false && JumpBool == true) { gameCtrl.addGameSession(finalScore, 0, totalTime, score, idMiniGame); performanceCtrl.addPerformance((int)JogThreshold, "16"); performanceCtrl.addPerformance((int)JumpThreshold, "7"); } if (JogBool == true && CrouchBool == true && JumpBool == false) { gameCtrl.addGameSession(finalScore, 0, totalTime, score, idMiniGame); performanceCtrl.addPerformance((int)JogThreshold, "16"); performanceCtrl.addPerformance((int)CrouchThreshold, "8"); } if (JogBool == true && CrouchBool == false && JumpBool == false) { gameCtrl.addGameSession(finalScore, 0, totalTime, score, idMiniGame); performanceCtrl.addPerformance((int)JogThreshold, "16"); } } if (this.withTime == false) { if (JogBool == true && CrouchBool == true && JumpBool == true) { gameCtrl.addGameSession(finalScore, 0, totalRepetitions, score, idMiniGame); performanceCtrl.addPerformance((int)JogThreshold, "16"); performanceCtrl.addPerformance((int)CrouchThreshold, "8"); performanceCtrl.addPerformance((int)JumpThreshold, "7"); } if (JogBool == false && CrouchBool == true && JumpBool == true) { gameCtrl.addGameSession(finalScore, 0, totalRepetitions, score, idMiniGame); performanceCtrl.addPerformance((int)CrouchThreshold, "8"); performanceCtrl.addPerformance((int)JumpThreshold, "7"); } if (JogBool == false && CrouchBool == false && JumpBool == true) { gameCtrl.addGameSession(finalScore, 0, totalRepetitions, score, idMiniGame); performanceCtrl.addPerformance((int)JumpThreshold, "7"); } if (JogBool == false && CrouchBool == true && JumpBool == false) { gameCtrl.addGameSession(finalScore, 0, totalRepetitions, score, idMiniGame); performanceCtrl.addPerformance((int)CrouchThreshold, "8"); } if (JogBool == true && CrouchBool == false && JumpBool == true) { gameCtrl.addGameSession(finalScore, 0, totalRepetitions, score, idMiniGame); performanceCtrl.addPerformance((int)JogThreshold, "16"); performanceCtrl.addPerformance((int)JumpThreshold, "7"); } if (JogBool == true && CrouchBool == true && JumpBool == false) { gameCtrl.addGameSession(finalScore, 0, totalRepetitions, score, idMiniGame); performanceCtrl.addPerformance((int)JogThreshold, "16"); performanceCtrl.addPerformance((int)CrouchThreshold, "8"); } if (JogBool == true && CrouchBool == false && JumpBool == false) { gameCtrl.addGameSession(finalScore, 0, totalRepetitions, score, idMiniGame); performanceCtrl.addPerformance((int)JogThreshold, "16"); } } 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; } StartCoroutine(DelayedFinalAnimation()); //resultsPanel.SetActive(true); }
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(); } }
private void EndGame() { mainPanel.SetActive(false); TherapySessionObject objTherapy = TherapySessionObject.tso; if (objTherapy != null) { //objTherapy.fillLastSession(score, fullScore, (int)totalTime, "0"); //objTherapy.saveLastGameSession(); //objTherapy.savePerformance((int)kickScript.BestLeftHipFrontAngle, "4"); //objTherapy.savePerformance((int)kickScript.BestRightHipFrontAngle, "5"); } string idMinigame = "11"; int finalScore; GameSessionDAO gameDao = new GameSessionDAO(); if (fullScore > 0) { finalScore = (int)(((float)score / fullScore) * 100.0f); } else { finalScore = 0; } resultsScoreText.text = "Desempeño: " + finalScore + "%"; GameSessionController gameCtrl = new GameSessionController(); int scoreBD = finalScore; if (withTime == true) { gameCtrl.addGameSession(score, 0, totalTime, scoreBD, idMinigame); } if (withTime == false) { gameCtrl.addGameSession(score, totalRepetitions, 0, scoreBD, idMinigame); } if (this.useFlexion == true) { sendPerformanceTouch(); } else { sendPerformancePinch(); } 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; } StartCoroutine(FinalAnimation()); }