コード例 #1
0
        IQuestionPack IQuestionProvider.GetNextQuestion()
        {
            var         answerData = AppManager.I.DB.GetWordDataByRandom();
            LL_WordData randomWord = new LL_WordData(answerData.Id, answerData);

            StringTestData fakeData = new StringTestData(
                ArabicAlphabetHelper.PrepareArabicStringForDisplay(
                    "منذ لم نرك منذ مدة " + randomWord.Data.Arabic + " منذ مدة" +
                    "منذ لم نرك منذ مدة " +
                    "منذ لم نرك منذ مدة "));

            List <ILivingLetterData> wrongAnswers = new List <ILivingLetterData>();

            while (wrongAnswers.Count < 6)
            {
                var randomData = AppManager.I.DB.GetWordDataByRandom();

                if (randomData.Id != answerData.Id && !wrongAnswers.Any((a) => { return(a.Id == randomData.Id); }))
                {
                    wrongAnswers.Add(randomData.ConvertToLivingLetterData());
                }
            }

            return(new SampleQuestionPack(fakeData, wrongAnswers, new ILivingLetterData[] { randomWord }));
        }
コード例 #2
0
 void updateText()
 {
     if (isTMPro)
     {
         if (isArabic)
         {
             if (isUI)
             {
                 gameObject.GetComponent <TextMeshProUGUI>().text = ArabicAlphabetHelper.PrepareArabicStringForDisplay(m_text);
             }
             else
             {
                 gameObject.GetComponent <TextMeshPro>().text = ArabicAlphabetHelper.PrepareArabicStringForDisplay(m_text);
             }
         }
         else
         {
             if (isUI)
             {
                 gameObject.GetComponent <TextMeshProUGUI>().text = m_text;
             }
             else
             {
                 gameObject.GetComponent <TextMeshPro>().text = m_text;
             }
         }
     }
     else
     {
         if (isArabic)
         {
             if (isUI)
             {
                 gameObject.GetComponent <Text>().text = ArabicAlphabetHelper.PrepareArabicStringForDisplay(m_text);
             }
             else
             {
                 gameObject.GetComponent <TextMesh>().text = ArabicAlphabetHelper.PrepareArabicStringForDisplay(m_text);
             }
         }
         else
         {
             if (isUI)
             {
                 gameObject.GetComponent <Text>().text = m_text;
             }
             else
             {
                 gameObject.GetComponent <TextMesh>().text = m_text;
             }
         }
     }
 }