Esempio n. 1
0
 void Start()
 {
     if (input == null)
     {
         input = TalkLoginStatic.my.yuanInput;
     }
 }
Esempio n. 2
0
    private void Add(string mTxt, Color mColor, string mPlayerID, string mPlayerName, bool isSelf)
    {
        numColor = 11 * 2;
        if (listInput.Count == 0 && listDisLink.Count == 0)
        {
            return;
        }

        string nextString = string.Empty;

        int numPlayerNum = 0;

        if (isSelf)
        {
            numPlayerNum = 0;
        }
        else
        {
            numPlayerNum = mPlayerName.Length + 1 + 4 + 1 + numColor;
        }



        //排除装备,道具和图纸
        if (
            mTxt.Length > 0 && mTxt.Length > numPlayerNum && mTxt.Substring(numPlayerNum, 1) == "[" &&
            (

                mTxt.Length == (9 + 2 + numPlayerNum) ||
                mTxt.Length == (25 + 2 + numPlayerNum) ||
                mTxt.Length == (40 + 2 + numPlayerNum)
            )
            )
        {
        }
        else
        {
            if (!isSelf)
            {
                if (string.IsNullOrEmpty(mPlayerName))
                {
                    numColor = 0;
                }
                if (mTxt.Length > numChat + numColor)
                {
                    string tempText = mTxt.Substring(0, numChat + numColor);
                    int    num      = 0;
                    if (tempText[tempText.Length - 1] == '[')
                    {
                        num = 4 - 1;
                    }
                    else if (tempText[tempText.Length - 2] == '[')
                    {
                        num = 4 - 2;
                    }
                    else if (tempText[tempText.Length - 3] == '[')
                    {
                        num = 4 - 3;
                    }
                    nextString = mTxt.Substring(numChat + num + numColor);
                    mTxt       = mTxt.Substring(0, numChat + num + numColor);
                }
            }
            else
            {
                if (mTxt.Length > numChat)
                {
                    string tempText = mTxt.Substring(0, numChat);
                    int    num      = 0;
                    if (tempText[tempText.Length - 1] == '[')
                    {
                        num = 4 - 1;
                    }
                    else if (tempText[tempText.Length - 2] == '[')
                    {
                        num = 4 - 2;
                    }
                    else if (tempText[tempText.Length - 3] == '[')
                    {
                        num = 4 - 3;
                    }
                    nextString = mTxt.Substring(numChat + num);
                    mTxt       = mTxt.Substring(0, numChat + num);
                }
            }
        }


        //		Debug.Log (string.Format ("+++++++++++++{0},{1},{2}",mPlayerID,mPlayerName,mTxt));
        if (nodeInput.Count > 0)
        {
            nodeDisInput.InNode(nodeInput.NodeTop());
            nodeInput.NodeTop().fontColor  = mColor;
            nodeInput.NodeTop().playerID   = mPlayerID;
            nodeInput.NodeTop().playerName = mPlayerName;
            nodeInput.NodeTop().Text       = mTxt;
            //			Debug.Log (string.Format ("&&&&&&&&&&-------{0},{1},{2}",nodeInput.NodeTop().playerID,nodeInput.NodeTop().playerName,nodeInput.NodeTop().Text));

            nodeInput.NodeTop().refresh = true;
            nodeInput.OutNode();
        }
        else
        {
            topInput           = nodeDisInput.NodeTop();
            topInput.fontColor = mColor;

            topInput.playerID   = mPlayerID;
            topInput.playerName = mPlayerName;
            topInput.Text       = mTxt;

            topInput.refresh = true;
            nodeDisInput.OutNode();
            nodeInput.InNode(topInput);
            nodeDisInput.InNode(nodeInput.NodeTop());
            nodeInput.OutNode();
        }

        TextSequence(nodeDisInput.ToList());


        if (!string.IsNullOrEmpty(nextString))
        {
            this.Add(nextString, mColor, mPlayerID, mPlayerName, true);
            //SendMessage (nextString,"","",messageType);
        }
        //scrollBar.scrollValue = 1;
    }