public void Next()
    {
        DialObject dial = dialObjects[current];

        current = dial.next;
        string text = current >= 0 ? dial.translatedText.GetCustomizedString() : "";

        control.SetText(text);
    }
示例#2
0
    public void Next()
    {
        XElement item;

        if (current >= 0)
        {
            item    = Enumerable.ElementAt(items, current);
            current = System.Convert.ToInt32(item.Attribute("next").Value);
        }
        string text = "";

        if (current >= 0)
        {
            item = Enumerable.ElementAt(items, current);
            text = item.Element(translationTag).Value;
        }


        control.SetText(text);
        if (text == "")
        {
            player.currentTalk = null;
            Time.timeScale     = 1f;
        }
        if (!Syncer.Instance.singlplayer)
        {
            byte[] txt     = System.Text.Encoding.UTF8.GetBytes(text);
            byte[] message = new byte[txt.Length + 5];
            message[0] = (byte)Syncer.MessageType.Talking;

            int i = 1;
            foreach (byte b in System.BitConverter.GetBytes(txt.Length))
            {
                message[i] = b;
                i++;
            }
            foreach (byte b in txt)
            {
                message[i] = b;
                i++;
            }
            foreach (byte b in txt)
            {
                message[i] = b;
                i++;
            }
            PlayGamesPlatform.Instance.RealTime.SendMessageToAll(true, message);
        }
    }