コード例 #1
0
    public void Init(Quizz q, Action <Quizz, int> onQuizzClick, int quizzOder = 0)
    {
        quidID        = quizzOder;
        quiz          = q;
        _OnQuizzClick = onQuizzClick;
        int num = 0;

        for (int i = 0; i < root.childCount; i++)
        {
            BoxWorld bx = root.GetChild(i).GetComponent <BoxWorld>();

            int startto = q.startFrom + q.keyword.Length;
            if (i >= q.startFrom && i < startto)
            {
                bx.Init(q.keyword[num].ToString(), false, false, false, GotoQuiz, quidID, num);
                if (i == q.keyhightlight)
                {
                    bx.Init(q.keyword[num].ToString(), false, false, true, GotoQuiz, quidID, num);
                }
                num++;
            }
            else
            {
                bx.Init("", true, false, false, GotoQuiz, quidID, -1);
            }
            if (q.keySetStart == i || q.keysetEnd == i)
            {
                bx.Init("", false, true, false, GotoQuiz, quidID, -1);
            }
        }
    }
コード例 #2
0
ファイル: QuizzPart2.cs プロジェクト: calvarycat/quizAboot
 public void ResetAns()
 {
     for (int i = 0; i < ans.transform.childCount; i++) // vì ở đây không có dấu sao hàng cuối
     {
         BoxWorld b = ans.transform.GetChild(i).GetComponent <BoxWorld>();
         b.Unmapkey();
         b._isSelect = true;
         b.HideLastItem();
     }
 }
コード例 #3
0
    public bool GetFillButton(int idButton)
    {
        QuizzItem q = UIQuiz.instance.listQuizzItem[currentSelectQuizz];

        for (int i = 0; i < q.transform.childCount; i++)
        {
            BoxWorld b = q.transform.GetChild(i).GetComponent <BoxWorld>();
            if (b.keyMaping == idButton)
            {
                return(true);
            }
        }
        return(false);
    }
コード例 #4
0
ファイル: QuizzPart2.cs プロジェクト: calvarycat/quizAboot
 void OnFillText(int idButton, string letter)
 {
     for (int i = 0; i < ans.transform.childCount; i++) // vì ở đây không có dấu sao hàng cuối
     {
         BoxWorld b = ans.transform.GetChild(i).GetComponent <BoxWorld>();
         b.HideLastItem();
         if (b.keyMaping == -1 && b.idButton >= 0)
         {
             b.ShowLastItem();
             b.OnMapingKey(idButton, letter);
             return;
         }
     }
 }
コード例 #5
0
ファイル: QuizzPart2.cs プロジェクト: calvarycat/quizAboot
 public void UnSetLetter(string letter, int idButton)
 {
     for (int i = 0; i < ans.transform.childCount; i++)
     {
         BoxWorld b = ans.transform.GetChild(i).GetComponent <BoxWorld>();
         b.HideLastItem();
         if (idButton == b.keyMaping)
         {
             b.ShowLastItem();
             // b.OnUnMapingKey(idButton, letter);
             b.Unmapkey();
         }
     }
 }
コード例 #6
0
ファイル: UIQuiz.cs プロジェクト: calvarycat/quizAboot
 public void OnUnFillText(int currentQuiz, int keyAnsID, string text)
 {
     if (listQuizzItem.Count > 0)
     {
         QuizzItem q = listQuizzItem[currentQuiz];
         for (int i = 0; i < q.transform.childCount - 1; i++)
         {
             BoxWorld b = q.transform.GetChild(i).GetComponent <BoxWorld>();
             b.HideLastItem();
             if (keyAnsID == b.keyMaping)
             {
                 b.Unmapkey();
                 b.ShowLastItem();
             }
         }
     }
     else
     {
         Debug.Log("null data");
     }
 }
コード例 #7
0
ファイル: QuizzPart2.cs プロジェクト: calvarycat/quizAboot
    public bool CheckFullAnswer()
    {
        bool rs = true;

        for (int i = 0; i < ans.transform.childCount; i++)
        {
            BoxWorld b = ans.transform.GetChild(i).GetComponent <BoxWorld>();
            if (b.idButton >= 0)
            {
                if (!string.IsNullOrEmpty(b.txtLableNomal.text))
                {
                    rs = true;
                }
                else
                {
                    rs = false;
                    break;
                }
            }
        }
        return(rs);
    }
コード例 #8
0
ファイル: QuizzPart2.cs プロジェクト: calvarycat/quizAboot
    bool CheckFinishRound2()
    {
        bool rs = true;

        for (int i = 0; i < ans.transform.childCount; i++)
        {
            BoxWorld b = ans.transform.GetChild(i).GetComponent <BoxWorld>();
            if (b.idButton >= 0)
            {
                if (b.txtLableNomal.text == b.rightAnser)
                {
                    rs = true;
                }
                else
                {
                    rs = false;
                    break;
                }
            }
        }
        return(rs);
    }
コード例 #9
0
    public bool CheckFullAnswer()
    {
        bool      rs = true;
        QuizzItem q  = UIQuiz.instance.listQuizzItem[currentSelectQuizz];

        for (int i = 0; i < q.transform.childCount; i++)
        {
            BoxWorld b = q.transform.GetChild(i).GetComponent <BoxWorld>();
            if (b.idButton >= 0)
            {
                if (!string.IsNullOrEmpty(b.txtLableNomal.text))
                {
                    rs = true;
                }
                else
                {
                    rs = false;
                    break;
                }
            }
        }
        return(rs);
    }
コード例 #10
0
ファイル: UIQuiz.cs プロジェクト: calvarycat/quizAboot
 public void OnFillText(int currentQuiz, int keyAnsID, string text)
 {
     if (listQuizzItem.Count > 0)
     {
         QuizzItem q = listQuizzItem[currentQuiz];
         for (int i = 0; i < q.transform.childCount - 1; i++)
         {
             BoxWorld b = q.transform.GetChild(i).GetComponent <BoxWorld>();
             b.HideLastItem();
             if (b.keyMaping == -1 && b.idButton >= 0)
             {
                 b.OnMapingKey(keyAnsID, text);
                 b.ShowLastItem();
                 return;
             }
         }
         QuizzDetail.instance.listGenerate[currentQuiz].currentSelectItem = QuizzDetail.instance.listGenerate[currentQuiz].currentSelectItem + 1;
     }
     else
     {
         Debug.Log("null data");
     }
 }
コード例 #11
0
    bool CheckLevelIsFinished()
    {
        bool      rs = true;
        QuizzItem q  = UIQuiz.instance.listQuizzItem[currentSelectQuizz];

        for (int i = 0; i < q.transform.childCount; i++)
        {
            BoxWorld b = q.transform.GetChild(i).GetComponent <BoxWorld>();
            if (b.idButton >= 0)
            {
                // char a = listGenerate[currentSelectQuizz].keyword[b.idButton];
                if (b.txtLableNomal.text == b.rightAnser)
                {
                    rs = true;
                }
                else
                {
                    rs = false;
                    break;
                }
            }
        }
        return(rs);
    }