Пример #1
0
    public void SendGame(int result, float time, float repetitions, int score, string minigame)
    {
        string date = date = DateTime.Now.ToString("yyyy-MM-dd");
        GameSessionController gameCtrl = new GameSessionController();

        gameCtrl.addGameSession(result, repetitions, time, score, minigame);
    }
    public void EndGame()
    {
        MainPanel.SetActive(false);
        PauseButton.SetActive(false);
        ResultPanel.SetActive(true);

        //print("puntos, " + total + " totales " + score +" deberia ser "+((score/total)*100));
        StopAllCoroutines();
        GiantRobot.enabled = false;
        InGame             = false;
        int    result     = Mathf.RoundToInt((score / total) * 100);
        string idMinigame = "2";
        GameSessionController gameCtrl = new GameSessionController();

        gameCtrl.addGameSession(result, this.FinalTotalRepetition, this.FinalTotalTime, score, idMinigame);
        results.Minigame = idMinigame;
        results          = ResultPanel.GetComponent <PutDataResults>();
        results.updateData(result, 0);

        int angle = (int)Maxangle;
        PerformanceController performanceCtrl = new PerformanceController();

        performanceCtrl.addPerformance(angle, this.GetMovement());

        //ParametersFIght pmFight = ParametersFIght();
        if (PlaylistManager.pm != null && PlaylistManager.pm.active)
        {
            PlaylistManager.pm.NextGame();
        }
        ;
    }
Пример #3
0
    public void EndGame()
    {
        //saveData ();

        int    performance_game      = Mathf.RoundToInt(((float)score_script.score_obtain / (float)score_script.score_max) * 100);
        int    performance_loaded_BD = 0;
        string idMinigame            = "6";

        results_script.Minigame = idMinigame;
        GameSessionController gameCtrl = new GameSessionController();

        if (modo_juego == 1)
        {
            gameCtrl.addGameSession(performance_game, select_jugabilidad, 0, score_script.score_obtain, idMinigame);
        }
        if (modo_juego == 1)
        {
            gameCtrl.addGameSession(performance_game, 0, select_jugabilidad, score_script.score_obtain, idMinigame);
        }
        results_script.updateData(performance_game, performance_loaded_BD);
        gestureManager.SetActive(false);
        spawnnerEnemies.can_spawn = false;
        hasStart = false;
        //paramenters_canvas.SetActive (true);

        PerformanceController performanceCtrl = new PerformanceController();

        performanceCtrl.addPerformance((int)Range, "38");

        FinalAnimation();
        if (PlaylistManager.pm != null && PlaylistManager.pm.active)
        {
            PlaylistManager.pm.NextGame();
        }
    }
Пример #4
0
    void Start()
    {
        gameSessionController = FindObjectOfType <GameSessionController>();
        spriteRenderer        = GetComponent <SpriteRenderer>();

        if (tag == "Breakable")
        {
            AddBlockToBreakableCount();
        }
    }
Пример #5
0
    void Start()
    {
        gameSession  = FindObjectOfType <GameSessionController>();
        shopCoins    = FindObjectOfType <ShopCoins>();
        shopFeedback = FindObjectOfType <ShopFeedback>();

        UpdateShopCoins();
        SetupShopMenu();
        CheckCoinAvailability();
    }
Пример #6
0
    private void GetCurrentPlayerStats()
    {
        gameSession = FindObjectOfType <GameSessionController>();

        lives = gameSession.Lives;
        shieldRechargeWaitTime = gameSession.ShieldRechargeTime;
        maxShield  = gameSession.Shield;
        shield     = maxShield;
        rockets    = gameSession.Rockets;
        maxRockets = gameSession.MaxRockets;
    }
Пример #7
0
    public void finalizarJuego()
    {
        //guardarDatos ();
        repeticionesRestantes = 0;
        repeticionesText.text = "0/0";
        game_over             = true;


        print("acabo juego");
        desempenio = (puntos / repeticionesTotales) * 100;
        string idMinigame            = "4";
        int    performance_loaded_BD = 0;

        panelResultados.SetActive(true);
        GameSessionController gameCtrl = new GameSessionController();

        if (modoPlay == 0)
        {
            float rep = 0;
            gameCtrl.addGameSession(desempenio, rep, valorPlay, desempenio, idMinigame);
            PerformanceController performanceCtrl = new PerformanceController();
            int angle = (int)anguloMax;

            performanceCtrl.addPerformance(angle, this.GetMovement());
        }
        if (modoPlay == 1)
        {
            float timer = 0;
            int   angle = (int)anguloMax;
            gameCtrl.addGameSession(desempenio, valorPlay, timer, desempenio, idMinigame);
            PerformanceController performanceCtrl = new PerformanceController();
            performanceCtrl.addPerformance(angle, this.GetMovement());
        }
        Debug.Log(desempenio);
        Debug.Log(performance_loaded_BD);
        Debug.Log(resultados + "resultados");
        if (resultados != null)
        {
            Debug.Log("entre");
            resultados.Minigame = idMinigame;

            resultados.updateData(desempenio, performance_loaded_BD);
        }

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

        //hasStart = false;
    }
    public void EndGame()
    {
        int performance_game = 0;

        if (score_script.score_max > 0)
        {
            performance_game = Mathf.RoundToInt(((float)score_script.score_obtain / (float)score_script.score_max) * 100);
        }

        int    performance_loaded_BD   = 0;
        string idMinigame              = "9";
        GameSessionController gameCtrl = new GameSessionController();

        if (HoldParametersVecinosInvasores.use_time == true)
        {
            gameCtrl.addGameSession(performance_game, 0, HoldParametersVecinosInvasores.select_jugabilidad, score_script.score_obtain, idMinigame);
        }
        if (HoldParametersVecinosInvasores.use_time == false)
        {
            gameCtrl.addGameSession(performance_game, HoldParametersVecinosInvasores.select_jugabilidad, 0, score_script.score_obtain, idMinigame);
        }


        PerformanceController performanceCtrl = new PerformanceController();

        if (HoldParametersVecinosInvasores.type_game == 0)
        {
            performanceCtrl.addPerformance(score_script.TouchPositive, "9");
        }
        if (HoldParametersVecinosInvasores.type_game == 1)
        {
            performanceCtrl.addPerformance(score_script.TouchPositive, "10");
        }
        results_script.Minigame = idMinigame;
        results_script.updateData(performance_game, performance_loaded_BD);

        hasStart = false;
        foreach (MonoBehaviour behaviour in array_scrips_disabled)
        {
            behaviour.enabled = false;
        }

        FinalAnimation();
    }
Пример #9
0
    public void EndGame()
    {
        //saveData ();

        int angle = (int)HoldParametersGreatJourney.select_angle_max;
        GameSessionController gameCtrl = new GameSessionController();

        int    performance_game      = Mathf.RoundToInt(((float)score_script.score_obtain / (float)score_script.score_max) * 100);
        int    performance_loaded_BD = 0;
        string idMinigame            = "3";

        if (HoldParametersGreatJourney.use_time == true)
        {
            float repetitionsC = 0;
            gameCtrl.addGameSession(performance_game, repetitionsC, HoldParametersGreatJourney.select_jugabilidad, score_script.score_obtain, idMinigame);
        }
        if (HoldParametersGreatJourney.use_time == false)
        {
            float repetitionsC = 0;
            gameCtrl.addGameSession(performance_game, HoldParametersGreatJourney.select_jugabilidad, repetitionsC, score_script.score_obtain, idMinigame);
        }
        PerformanceController performanceCtrl = new PerformanceController();

        performanceCtrl.addPerformance(angle, this.GetMovement());
        results_script.Minigame = "3";
        results_script.updateData(performance_game, performance_loaded_BD);

        hasStart = false;
        //paramenters_canvas.SetActive (true);
        foreach (MonoBehaviour behaviour in array_scrips_disabled)
        {
            behaviour.enabled = false;
        }

        FinalAnimation();



        if (PlaylistManager.pm != null && PlaylistManager.pm.active)
        {
            PlaylistManager.pm.NextGame();
        }
    }
Пример #10
0
    public void EndGame()
    {
        /*_angleMinLeft = 0;
         * sliderMinLeft.value = 0;
         * sliderLeft.value = 0;
         * _angleLeft = 0;*/

        MainPanel.SetActive(false);
        pausa.SetActive(false);
        ResultPanel.SetActive(true);
        danceTaichi.SetActive(false);
        danceUnityChan.SetActive(false);
        StopAllCoroutines();
        InGame = false;
        int    result     = Mathf.RoundToInt((score / lanzamiento) * 100);
        string idMinigame = "1";

        //print(lanzamiento);
        movimientoLateral = false;
        int angle = (int)_angleLeft;
        GameSessionController gameCtrl = new GameSessionController();

        gameCtrl.addGameSession(score, this.FinalTotalRepetition, this.FinalTotalTime, result, idMinigame);
        PerformanceController performanceCtrl = new PerformanceController();

        performanceCtrl.addPerformance(angle, this.GetMovement());
        results          = ResultPanel.GetComponent <PutDataResults>();
        results.Minigame = idMinigame;
        results.updateData(result, 0);


        if (PlaylistManager.pm != null && PlaylistManager.pm.active)

        {
            PlaylistManager.pm.NextGame();
        }
    }
Пример #11
0
 void Start()
 {
     defEnemiesText = GetComponent <Text>();
     gameSession    = FindObjectOfType <GameSessionController>();
 }
Пример #12
0
 void Start()
 {
     gameSessionController = FindObjectOfType <GameSessionController>();
 }
Пример #13
0
        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();
            }
        }
Пример #14
0
    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);
    }
 void Start()
 {
     gameSessionController = FindObjectOfType <GameSessionController>();
     ball         = FindObjectOfType <BallController>();
     initialScale = transform.localScale;
 }
Пример #16
0
    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());
    }