示例#1
0
    //public void initAsVowel();
    public void initPanel()
    {
        Sprite sprt = PpChooseLetter.instance.GetComponent <ImagesManager>().getImage();

        if (sprt == null)
        {
            return;
        }
        sr_showImage.sprite = sprt;
        sr_showImage.color  = Color.white;
        if (sprt.name.StartsWith("A"))
        {
            letter = EnumsGame.LETTERS.A;
        }
        else if (sprt.name.StartsWith("E"))
        {
            letter = EnumsGame.LETTERS.E;
        }
        else if (sprt.name.StartsWith("I"))
        {
            letter = EnumsGame.LETTERS.I;
        }
        else if (sprt.name.StartsWith("O"))
        {
            letter = EnumsGame.LETTERS.O;
        }
        else if (sprt.name.StartsWith("U"))
        {
            letter = EnumsGame.LETTERS.U;
        }
    }
 void Awake()
 {
     if (type.Equals(EnumsGame.TYPE_BOX.IMAGE_BOX_RAND_VOWEL))
     {
         letter_a = GameSettings.getLowercaseVowels()[Random.Range(0, 5)];
     }
     audios = GetComponent <PlayerAudios>();
 }
示例#3
0
 public LetterInfoW01(EnumsGame.LETTERS letter, int right, int wrong, float time)
 {
     this.letter = letter;
     this.right  = right;
     this.wrong  = wrong;
     timeList    = new List <float>();
     timeList.Add(time);
 }
示例#4
0
    void OnTriggerEnter2D(Collider2D col)
    {
        SwitchMachine sm = col.GetComponent <SwitchMachine>();

        if (sm != null)
        {
            letterSwitch      = sm.Letter;
            testOnTriggerStay = false;
        }
    }
 public void addWrongLetter(EnumsGame.LETTERS letter, float timeToChoose)
 {
     //Debug.Log("Wrong " + GameSettings.enum2letter(letter) + " in " + timeToChoose + " seconds.");
     foreach (LetterInfoW01 l in turnData.letters)
     {
         if (l.Letter.Equals(letter))
         {
             l.addWrong(timeToChoose);
             return;
         }
     }
     turnData.letters.Add(new LetterInfoW01(letter, 0, 1, timeToChoose));
 }
示例#6
0
    //Retorna um sprite para letra (seu nome em português).
    public static Sprite getImageByLeterPT(EnumsGame.LETTERS letter)
    {
        Sprite retorno = null;

        if (letter.Equals(EnumsGame.LETTERS.Am) || letter.Equals(EnumsGame.LETTERS.A))
        {
            int val = Random.Range(0, 5);

            var myAsset = AssetBundle.LoadFromFile(Application.streamingAssetsPath + "/boximages");

            if (myAsset == null)
            {
                Debug.Log("Não carregou!");
            }

            if (val == 0)
            {
                retorno = myAsset.LoadAsset <Sprite>("abacate");
            }
            else if (val == 1)
            {
                retorno = myAsset.LoadAsset <Sprite>("abelha");
            }
            else if (val == 2)
            {
                retorno = myAsset.LoadAsset <Sprite>("anel");
            }
            else if (val == 3)
            {
                retorno = myAsset.LoadAsset <Sprite>("arvore");
            }
            else if (val == 4)
            {
                retorno = myAsset.LoadAsset <Sprite>("aviao");
            }

            //retorno = myAsset.LoadAsset<Sprite>("aba");
        }

        return(retorno);
    }
示例#7
0
    public void putAnswer(EnumsGame.LETTERS l_answer)
    {
        if (timeToResp > 0)
        {
            return;
        }

        if (switchManager.AskPanel.letter.Equals(l_answer))
        {
            resultRightWrong[0]++;
            switchManager.animaResp(true);
            PlayerData.instance.addRightLetter(switchManager.AskPanel.letter, timeToChoose);

            for (int i = 0; i < coins.Length; i++)
            {
                coins[i].gameObject.SetActive(true);
                coins[i].transform.localPosition = Vector3.zero;
                coins[i].throwMe(forces[i], coinsChest);
            }
        }
        else
        {
            resultRightWrong[1]++;
            switchManager.animaResp(false);
            PlayerData.instance.addWrongLetter(switchManager.AskPanel.letter, timeToChoose);
        }

        if (GetComponent <ImagesManager>().sprites.Count == 0)
        {
        }
        else
        {
            //Nova pergunta
            addNesAsk  = true;
            timeToResp = 0.6f;
        }

        t_result[0].text = resultRightWrong[0] + "";
        t_result[1].text = resultRightWrong[1] + "";
    }
示例#8
0
    //Function thats receive a enum LETER and returns the equivalente letter as string
    public static string enum2letter(EnumsGame.LETTERS letter)
    {
        //Vogais minúsculas / maiúsculas
        if (letter.Equals(EnumsGame.LETTERS.Am))
        {
            return("a");
        }
        else if (letter.Equals(EnumsGame.LETTERS.Em))
        {
            return("e");
        }
        else if (letter.Equals(EnumsGame.LETTERS.Im))
        {
            return("i");
        }
        else if (letter.Equals(EnumsGame.LETTERS.Om))
        {
            return("o");
        }
        else if (letter.Equals(EnumsGame.LETTERS.Um))
        {
            return("u");
        }
        else if (letter.Equals(EnumsGame.LETTERS.A))
        {
            return("A");
        }
        else if (letter.Equals(EnumsGame.LETTERS.E))
        {
            return("E");
        }
        else if (letter.Equals(EnumsGame.LETTERS.I))
        {
            return("I");
        }
        else if (letter.Equals(EnumsGame.LETTERS.O))
        {
            return("O");
        }
        else if (letter.Equals(EnumsGame.LETTERS.U))
        {
            return("U");
        }

        //Consoantes
        else if (letter.Equals(EnumsGame.LETTERS.B))
        {
            return("B");
        }
        else if (letter.Equals(EnumsGame.LETTERS.C))
        {
            return("C");
        }
        else if (letter.Equals(EnumsGame.LETTERS.D))
        {
            return("D");
        }
        else if (letter.Equals(EnumsGame.LETTERS.F))
        {
            return("F");
        }
        else if (letter.Equals(EnumsGame.LETTERS.G))
        {
            return("G");
        }
        else if (letter.Equals(EnumsGame.LETTERS.H))
        {
            return("H");
        }
        else if (letter.Equals(EnumsGame.LETTERS.J))
        {
            return("J");
        }
        else if (letter.Equals(EnumsGame.LETTERS.K))
        {
            return("K");
        }
        else if (letter.Equals(EnumsGame.LETTERS.L))
        {
            return("L");
        }
        else if (letter.Equals(EnumsGame.LETTERS.M))
        {
            return("M");
        }
        else if (letter.Equals(EnumsGame.LETTERS.N))
        {
            return("N");
        }
        else if (letter.Equals(EnumsGame.LETTERS.P))
        {
            return("P");
        }
        else if (letter.Equals(EnumsGame.LETTERS.Q))
        {
            return("Q");
        }
        else if (letter.Equals(EnumsGame.LETTERS.R))
        {
            return("R");
        }
        else if (letter.Equals(EnumsGame.LETTERS.S))
        {
            return("S");
        }
        else if (letter.Equals(EnumsGame.LETTERS.T))
        {
            return("T");
        }
        else if (letter.Equals(EnumsGame.LETTERS.V))
        {
            return("V");
        }
        else if (letter.Equals(EnumsGame.LETTERS.W))
        {
            return("W");
        }
        else if (letter.Equals(EnumsGame.LETTERS.X))
        {
            return("X");
        }
        else if (letter.Equals(EnumsGame.LETTERS.Y))
        {
            return("Y");
        }
        else if (letter.Equals(EnumsGame.LETTERS.Z))
        {
            return("Z");
        }

        return("");
    }