예제 #1
0
    //method to display text on screen and play sound
    public void displayNextLet(string stage)
    {
        try
        {
            switch (stage)
            {
            case "first":
                //count should be 0
                learnModeS = masterInt.currentMode;

                break;

            case "next":

                bool check = masterInt.learnMode.Count - 1 == count;
                Debug.Log("next: " + masterInt.learnMode.Count + " vs " + count + "triggers " + check);
                if (masterInt.learnMode.Count - 1 == count)
                {
                    dontPlay = true;
                    count    = 0;
                    master.startTest();
                    //learnList.Clear();
                    break;
                }
                count++;
                master.playStrum();
                break;

            case "back":
                if (count == 0 || count == -1)
                {
                }
                else
                {
                    count--;
                }

                break;
            }
        }
        catch (Exception e)
        {
            Debug.Log(e);
        }

        bool   android = true;
        AlphaB targ    = masterInt.learnMode[count];

        string soundSt = "file://" + Application.streamingAssetsPath + "/Hira/" + targ.rom.Trim() + ".wav";

        if (master.isThisMobile)
        {
            soundSt = "jar:file://" + Application.dataPath + "!/assets/" + "Hira/" + targ.rom.Trim() + ".wav";
        }
        pathF = soundSt;



        if (learnModeS.Equals("hira"))
        {
            letterDisp.SetText(targ.hira);
            katta.SetText(targ.kata);
            defin.SetText(targ.rom);
            tyNote.SetText(targ.ty);
            whatShows1.SetText(wordList.hiragaW);
            whatShows2.SetText(wordList.KataW);
        }
        else if (learnModeS.Equals("kata"))
        {
            Debug.Log("Kata Display normal mode");
            letterDisp.SetText(targ.kata);
            katta.SetText(targ.hira);
            defin.SetText(targ.rom);
            tyNote.SetText(targ.ty);
            whatShows1.SetText(wordList.KataW);
            whatShows2.SetText(wordList.hiragaW);
        }
        else
        {
            if (targ.userHira < targ.userKat)
            {
                letterDisp.SetText(targ.kata);
                katta.SetText(targ.hira);
                defin.SetText("");
                tyNote.SetText("");
                whatShows1.SetText(wordList.KataW);
                whatShows2.SetText(wordList.hiragaW);
            }
            else
            {
                letterDisp.SetText(targ.hira);
                katta.SetText(targ.kata);
                defin.SetText("");
                tyNote.SetText("");
                whatShows1.SetText(wordList.hiragaW);
                whatShows2.SetText(wordList.KataW);
            }
        }


        if (dontPlay == false)
        {
            playSound();
        }
    }