Пример #1
0
 public void OnShopPressed()
 {
     DestroyAD();
     MusicPlayer.PlayShopMusic();
     ShopMenu.Show();
 }
Пример #2
0
    void ShowDialog()
    {
        bool cont = false;

        string str = stringArray[m_dialogIndexNext];

        if (str[0] == '[')
        {
            string[] strArr = str.Split(']');
            string[] inside = strArr[0].Substring(1).Split(' ');
            switch (inside[0])
            {
            case "passage":
                cont = true;
                break;

            case "name":
                targetName.text = strArr[1];
                cont            = true;
                break;

            case "choice":
                m_dialogIndexNext++;
                showChoices();
                break;

            case "end":
                TriggerEvent(this, "dialogEnd");
                break;

            case "trig":
                string strTrig = "";
                for (int i = 1; i < inside.Length; i++)
                {
                    if (i < inside.Length - 1)
                    {
                        strTrig = strTrig + inside[i] + " ";
                    }
                    else
                    {
                        strTrig = strTrig + inside[i];
                    }
                }
                TriggerEvent(this, strTrig);
                cont = true;
                break;

            case "jump":
                m_dialogIndexNext = m_pStart + int.Parse(inside[1]) - 1;
                cont = true;
                break;

            case "jumpRelative":
                m_dialogIndexNext += int.Parse(inside[1]) - 1;
                cont = true;
                break;

            case "hide":
                chatBoxRoot.SetActive(false);
                cont = true;
                break;

            case "show":
                chatBoxRoot.SetActive(true);
                cont = true;
                break;

            case "wait":
                TriggerEvent(this, "dialogContinue", float.Parse(inside[1]));
                break;

            case "blackScreenOn":
                m_UIController.BlackScreenOn(float.Parse(inside[1]));
                cont = true;
                break;

            case "blackScreenOff":
                m_UIController.BlackScreenOff(float.Parse(inside[1]));
                cont = true;
                break;

            case "shopMenu":
                m_shopMenu.Show(int.Parse(inside[1]));
                m_state = DialogShowerState.WaitForShop;
                break;
            }
        }
        else
        {
            chatText.text = str;
            m_state       = DialogShowerState.Showing;
            TriggerEvent(this, "wait4click", 0.5f);
        }

        m_dialogIndexNext++;

        //if next is choice then continue
        if (m_dialogIndexNext < stringArray.Length)
        {
            str = stringArray[m_dialogIndexNext].Split(' ')[0];
            if (str.Equals("[choice]"))
            {
                cont = true;
            }
        }

        if (cont)
        {
            ShowDialog();
        }
        return;
    }
Пример #3
0
 public void OnShopClick()
 {
     Hide();
     ShopMenu.Show();
 }