internal void ShowPreviewGame(Game game)
        {
            //AppController.GetController().SetCurrentGame(0); // todo
            // AppController.GetController().SetCurrentArea(game.GetArea());
            ViewController.GetController().SetCanvasScaler(1f);
            AppController.GetController().SetCurrentGame(game.GetId());
            gamePreview.SetGameDescription(game.GetDescriptions()[SettingsController.GetController().GetLanguage()]);
            gamePreview.SetPossibleLevels(game.GetLevels());
            gamePreview.SetImages(game.GetIcon(), areaColors[game.GetArea()]);
            gamePreview.gameObject.SetActive(true);
            menuView.gameObject.SetActive(false);

            foreach (Animator animator in InstructionController.GetController().Animators)
            {
                Destroy(animator.gameObject);
            }
            InstructionController.GetController().Animators.Clear();
            foreach (GameObject instruction in game.InstructionsSequence)
            {
                GameObject instantiate = Instantiate(instruction);
                ViewController.GetController().FitObjectTo(instantiate, gamePreview.InstructionPanel);
                InstructionController.GetController().Animators.Add(instantiate.GetComponent<Animator>());
            }

            foreach (Instruction instruction in gamePreview.InstructionPanel.GetComponentsInChildren<Instruction>(true))
            {
                instruction.gameObject.SetActive(false);
            }

            //Animator[] componentsInChildren = gamePreview.InstructionPanel.GetComponentsInChildren<Animator>(true);
            /* for (int i = 0; i < componentsInChildren.Length ; i++)
             {
                 InstructionController.GetController().Animators.Add(componentsInChildren[i]);
             }*/
        }
Example #2
0
 internal void SetAttributes(Game game, Color color)
 {
     this.data = game;
     gameName.text = game.GetNames()[SettingsController.GetController().GetLanguage()];
     areaImage.sprite = game.GetIcon();
     gameObject.GetComponent<Image>().color = color;
 }
Example #3
0
        private void AddMetricRow(Game game, int level)
        {
            GameMetrics gameMetric = MetricsController.GetController().GetBestMetric(game.GetArea(), game.GetId(), level);
            if(gameMetric == null) return;
            GameObject row = Instantiate(metricsRowPrefab);
            viewRows.Add(row.GetComponent<MetricsRow>());

            if (gameMetric == null)
            {
                row.GetComponent<MetricsRow>().SetScore(0);
                row.GetComponent<MetricsRow>().SetStars(0);
                row.GetComponent<MetricsRow>().SetArea(game.GetArea());
                row.GetComponent<MetricsRow>().SetIndex(game.GetId());
                row.GetComponent<MetricsRow>().DisableViewDetails();

            } else
            {
                row.GetComponent<MetricsRow>().SetScore(gameMetric.GetScore());
                row.GetComponent<MetricsRow>().SetStars(gameMetric.GetStars());
                row.GetComponent<MetricsRow>().SetArea(gameMetric.GetArea());
                row.GetComponent<MetricsRow>().SetIndex(gameMetric.GetIndex());
            }
               // row.GetComponent<MetricsRow>().SetActivity(AppController.GetController().GetActivityName(area, game));
            row.GetComponent<MetricsRow>().SetActivity(game.GetNames()[SettingsController.GetController().GetLanguage()]);

            row.GetComponent<MetricsRow>().SetLevel(level);
            row.GetComponent<MetricsRow>().SetIcon(game.GetIcon());

            FitRowToPanel(row);
        }
        public void Play(Game game)
        {
            string[] textStrings = SettingsController.GetController().GetLanguage() == 0
                    ? game.SpanishInstructionStrings
                    : game.EnglishInstructionStrings;
            List<Text> texts = new List<Text>();
            for (int i = 0; i < Animators.Count; i++)
            {
                Instruction instruction = Animators[i].gameObject.GetComponent<Instruction>();
                texts.AddRange(instruction.Texts);
                instruction.gameObject.SetActive(instruction.VisibleAtStart);
                Animators[i].SetBool("play", false);
            }

            if(texts.Count != textStrings.Length) throw new Exception("Diferente cantidad");

            for (int i = textStrings.Length - 1; i >= 0; i--)
            {
                texts[i].text = textStrings[i];
            }

            _currentAnimation = -1;
            NextAnimation();
        }
 internal void UpdateTexts(Game game, int language)
 {
     gameNameTxt.text = game.GetNames()[language];
     titleTxt.text = game.GetTitles()[language];
     sentenceText.text = language == 0 ? "Se necesita obtener exactamente X l" : "You need obtain exactly X l";
 }
 private void SetTexts(Game game, int language)
 {
     gameName.text = game.GetNames()[language];
     title.text = game.GetTitles()[language];
 }
Example #7
0
 private void UpdateTexts(Game game, int language)
 {
     gameNameTxt.text = game.GetNames()[language];
     titleTxt.text = game.GetTitles()[language];
 }
Example #8
0
 internal void UpdateTexts(Game game, int laguange)
 {
     gameNameText.text = game.GetNames()[laguange];
     titleText.text = game.GetTitles()[laguange];
     TotalText.text = "" + 0;
 }
Example #9
0
 void SetTexts(Game game, int language)
 {
     title.text = game.GetNames()[language];
     rules.text = game.GetTitles()[language];
 }
        internal void UpdateTexts(Game game, int language)
        {
            gameNameText.text = game.GetNames()[language];
            titleText.text = game.GetTitles()[language];
            switch (language)
            {
                case 0:
                    //titleText.text = "Descompone la suma para llegar al resultado";
                    rowNames[0].text = "Unos:";
                    rowNames[1].text = "Dieces:";
                    rowNames[2].text = "Cienes:";
                    rowNames[3].text = "Miles:";
                    rowNames[4].text = "Diez miles:";
                    break;
                default:

                    //titleText.text = "Decomposes the sum to get the result";
                    rowNames[0].text = "Units:";
                    rowNames[1].text = "Tens:";
                    rowNames[2].text = "Hundreds:";
                    rowNames[2].fontSize -= 5;
                    rowNames[3].text = "Thousands:";
                    rowNames[4].text = "Tens of thousands:";
                    rowNames[3].fontSize -= 5;
                    rowNames[4].fontSize -= 5;
                    break;
            }
        }
Example #11
0
 internal void StartGame(Game game)
 {
     ChangeCurrentObject(LoadPrefab("Games/" + game.GetPrefabName()));
     SetCanvasScalerToCurrentGame();
 }
 private void UpdateTexts(Game game, int langugage)
 {
     title.text = game.GetNames()[langugage];
     rules.text = game.GetTitles()[langugage];
 }
Example #13
0
        private void UpdateTexts(Game game, int language)
        {
            gameNameTxt.text = game.GetNames()[language];
            titleTxt.text = game.GetTitles()[language];
            /*switch (Settings.SettingsController.GetController().GetLanguage())
            {
                case 0:
                    gameNameTxt.text = "LA PIEZA\nFALTANTE";

                    titleTxt.text = "Selecciona la fracción que representa la porción de la derecha";
                    break;
                default:
                    gameNameTxt.text = "THE MISSING\nPART";
                    titleTxt.text = "Select the fraction that represents the portion of the right";
                    break;
            }*/
        }
 private void UpdateTexts(Game gameInfo, int langauge)
 {
     gameNameTxt.text = gameInfo.GetNames()[langauge];
     titleTxt.text = gameInfo.GetTitles()[langauge];
 }
        private void UpdateTexts(Game game, int language)
        {
            gameNameTxt.text = game.GetNames()[language];
            titleTxt.text = game.GetTitles()[language];
              /*  switch ()
            {
                case 0:
                    gameNameTxt.text = "DISTRIBUCIÓN\nDE PORCENTAJES";

                    titleTxt.text = "Distribuye en partes iguales";
                    break;
                default:
                    gameNameTxt.text = "DISTRIBUTION \nPERCENTAGES";
                    titleTxt.text = "Distributed equally";
                    break;
            }
            */
        }
Example #16
0
 void SetTexts(Game game, int language)
 {
     title.text = game.GetNames()[language];
     rules.text = game.GetTitles()[language];
     //title.text = I18n.Msg("numbersLine.title");
     //rules.text = I18n.Msg("numbersLine.rules");
 }
 internal void UpdateTexts(Game game, int language)
 {
     typeAngleToggles[0].GetComponentInChildren<Text>().text = I18n.Msg("acute");
     typeAngleToggles[1].GetComponentInChildren<Text>().text = I18n.Msg("right");
     typeAngleToggles[2].GetComponentInChildren<Text>().text = I18n.Msg("obtuse");
     gameNameTxt.text = game.GetNames()[language];
     titleTxt.text = game.GetTitles()[language];
 }