Пример #1
0
    public void doSubGet(ref List <DinhNui> lst)
    {
        if (lst.Count > 0)
        {
            int    chon  = UnityEngine.Random.Range(0, lst.Count);
            string tamct = lst[chon].Question.Trim();
            if (tamct.StartsWith("tao") || tamct.StartsWith("hoa") || tamct.StartsWith("meo"))
            {
                txtContent.gameObject.SetActive(false);
                spContent.gameObject.SetActive(true);
                spContent.SetSprite(tamct);
            }
            else
            {
                txtContent.gameObject.SetActive(true);
                spContent.gameObject.SetActive(false);
                txtContent.text = lst[chon].Question;
            }
            xulyPS(lst[chon].Casea.Trim(), "A", txtA, btnA);
            xulyPS(lst[chon].Caseb.Trim(), "B", txtB, btnB);
            xulyPS(lst[chon].Casec.Trim(), "C", txtC, btnC);
            xulyPS(lst[chon].Cased.Trim(), "D", txtD, btnD);
            string giaithich;

            if (GameController.instance.checkvip == 10 || GameController.instance.level == 1)
            {
                giaithich = lst[chon].Giaithich.Trim();
                if (giaithich.Equals("giaithich") || giaithich.Equals("gta"))
                {
                    string kq = "";
                    if (lst[chon].Truecase == 1)
                    {
                        kq = lst[chon].Casea;
                    }
                    else if (lst[chon].Truecase == 2)
                    {
                        kq = lst[chon].Caseb;
                    }
                    if (lst[chon].Truecase == 3)
                    {
                        kq = lst[chon].Casec;
                    }
                    else if (lst[chon].Truecase == 4)
                    {
                        kq = lst[chon].Cased;
                    }
                    giaithich = ClsLanguage.doDapSo() + kq;
                }
            }
            else
            {
                string kq = "";
                if (lst[chon].Truecase == 1)
                {
                    kq = lst[chon].Casea;
                }
                else if (lst[chon].Truecase == 2)
                {
                    kq = lst[chon].Caseb;
                }
                if (lst[chon].Truecase == 3)
                {
                    kq = lst[chon].Casec;
                }
                else if (lst[chon].Truecase == 4)
                {
                    kq = lst[chon].Cased;
                }

                giaithich = ClsLanguage.doDapSo() + kq + ClsLanguage.doBanCanMuaVip();
            }



            txtGiaiThich.text = ClsLanguage.doGiaiThich() + "" + giaithich;
            truecase          = lst[chon].Truecase;
            lst.RemoveAt(chon);
            sttQuestion++;
            txtTitle.text = ClsLanguage.doQuestion() + " " + sttQuestion + ".";
        }
        else
        {
        }
    }
Пример #2
0
    public void doSubGet(ref List <DinhNui> lst)
    {
        if (lst.Count > 0)
        {
            int chon = UnityEngine.Random.Range(0, lst.Count);
            txtContent.text = lst[chon].Question;
            doBtnData(btnA.transform, lst [chon].Casea, "A");
            doBtnData(btnB.transform, lst [chon].Caseb, "B");
            doBtnData(btnC.transform, lst [chon].Casec, "C");
            doBtnData(btnD.transform, lst [chon].Cased, "D");
            string giaithich;

            if (VioGameController.instance.checkvip == 10 || VioGameController.instance.level == 1)
            {
                giaithich = lst[chon].Giaithich.Trim();
                if (giaithich.Equals("giaithich") || giaithich.Equals("gta"))
                {
                    string kq = "";
                    if (lst[chon].Truecase == 1)
                    {
                        kq = lst[chon].Casea;
                    }
                    else if (lst[chon].Truecase == 2)
                    {
                        kq = lst[chon].Caseb;
                    }
                    if (lst[chon].Truecase == 3)
                    {
                        kq = lst[chon].Casec;
                    }
                    else if (lst[chon].Truecase == 4)
                    {
                        kq = lst[chon].Cased;
                    }
                    giaithich = ClsLanguage.doDapSo() + kq;
                }
            }
            else
            {
                string kq = "";
                if (lst[chon].Truecase == 1)
                {
                    kq = lst[chon].Casea;
                }
                else if (lst[chon].Truecase == 2)
                {
                    kq = lst[chon].Caseb;
                }
                if (lst[chon].Truecase == 3)
                {
                    kq = lst[chon].Casec;
                }
                else if (lst[chon].Truecase == 4)
                {
                    kq = lst[chon].Cased;
                }

                giaithich = "\n" + ClsLanguage.doDapSo() + kq + ClsLanguage.doBanCanMuaVip();
            }



            txtGiaiThich.text = lst[chon].Question + "\n" + ClsLanguage.doGiaiThich() + "\n" + giaithich;
            truecase          = lst[chon].Truecase;
            lst.RemoveAt(chon);
            sttQuestion++;
            if (!VioGameController.instance.tienganh)
            {
                switch (sttQuestion)
                {
                case 1:
                    SoundController.Instance.PlayHoi1();
                    break;

                case 2:
                    SoundController.Instance.PlayHoi2();
                    break;

                case 3:
                    SoundController.Instance.PlayHoi3();
                    break;

                case 4:
                    SoundController.Instance.PlayHoi4();
                    break;

                case 5:
                    SoundController.Instance.PlayHoi5();
                    break;

                case 6:
                    SoundController.Instance.PlayHoi6();
                    break;

                case 7:
                    SoundController.Instance.PlayHoi7();
                    break;

                case 8:
                    SoundController.Instance.PlayHoi8();
                    break;

                case 9:
                    SoundController.Instance.PlayHoi9();
                    break;

                default:
                    SoundController.Instance.PlayHoi10();
                    break;
                }
            }
            txtTitle.text = ClsLanguage.doQuestion() + " " + sttQuestion + ".";
        }
        else
        {
        }
        LaiVanSam.SetSprite("hoi");
    }
Пример #3
0
    public void doSubGet(ref List <ThongThai> lst)
    {
        if (lst.Count > 0)
        {
            currentState = State.InGame;
            int chon = UnityEngine.Random.Range(0, lst.Count);
            sttQuestion++;
            txtContent.text = ClsLanguage.doQuestion() + " " + sttQuestion + ":" + "\n\n" + lst [chon].Question;
            mKetQuaDung     = lst [chon].Ketqua;
            if (VioGameController.instance.checkvip == 10 || VioGameController.instance.level == 1)
            {
                if (lst [chon].Giaithich.Equals("gta") || lst [chon].Giaithich.Equals(""))
                {
                    txtGiaiThich.text = ClsLanguage.doQuestion() + " " + sttQuestion + ":" + "\n\n" + lst [chon].Question + "\n\n" + ClsLanguage.doDapSo() + mKetQuaDung;
                }
                else
                {
                    txtGiaiThich.text = ClsLanguage.doQuestion() + " " + sttQuestion + ":" + "\n" + lst [chon].Question + "\n\n" + ClsLanguage.doDapSo() + lst [chon].Giaithich;
                }
            }
            else
            {
                txtGiaiThich.text = ClsLanguage.doQuestion() + " " + sttQuestion + ":" + "\n\n" + lst [chon].Question + "\n\n" + ClsLanguage.doDapSo() + mKetQuaDung + ClsLanguage.doBanCanMuaVip();
            }
            txtContent.gameObject.SetActive(true);
            txtGiaiThich.gameObject.SetActive(false);
            mThaoTac.SetActive(true);
            spMonkey.SetSprite("khihoi");
            mBangHoi.transform.localPosition = startPosvisi;
            stSum          = "";
            txtKetQua.text = "";
            btnContinute.gameObject.SetActive(false);

            lst.RemoveAt(chon);
        }
    }
Пример #4
0
    public void doSubGet(ref List <DinhNui> lst)
    {
        if (lst.Count > 0)
        {
            int chon = UnityEngine.Random.Range(0, lst.Count);
            txtContent.text = lst[chon].Question;
            txtA.text       = "A." + lst[chon].Casea;
            txtB.text       = "B." + lst[chon].Caseb;
            txtC.text       = "C." + lst[chon].Casec;
            txtD.text       = "D." + lst[chon].Cased;
            string giaithich;

            if (GameController.instance.checkvip == 10 || GameController.instance.level == 1)
            {
                giaithich = lst[chon].Giaithich.Trim();
                if (giaithich.Equals("giaithich") || giaithich.Equals("gta"))
                {
                    string kq = "";
                    if (lst[chon].Truecase == 1)
                    {
                        kq = lst[chon].Casea;
                    }
                    else if (lst[chon].Truecase == 2)
                    {
                        kq = lst[chon].Caseb;
                    }
                    if (lst[chon].Truecase == 3)
                    {
                        kq = lst[chon].Casec;
                    }
                    else if (lst[chon].Truecase == 4)
                    {
                        kq = lst[chon].Cased;
                    }
                    giaithich = ClsLanguage.doDapSo() + kq;
                }
            }
            else
            {
                string kq = "";
                if (lst[chon].Truecase == 1)
                {
                    kq = lst[chon].Casea;
                }
                else if (lst[chon].Truecase == 2)
                {
                    kq = lst[chon].Caseb;
                }
                if (lst[chon].Truecase == 3)
                {
                    kq = lst[chon].Casec;
                }
                else if (lst[chon].Truecase == 4)
                {
                    kq = lst[chon].Cased;
                }

                giaithich = ClsLanguage.doDapSo() + kq + ClsLanguage.doBanCanMuaVip();
            }



            txtGiaiThich.text = ClsLanguage.doGiaiThich() + "\n\n" + giaithich;
            truecase          = lst[chon].Truecase;
            lst.RemoveAt(chon);
            sttQuestion++;
        }
        else
        {
        }
    }