예제 #1
0
    public CharChatBillboardSprite CreateChatSprite()
    {
        if (this.m_pkHeadUpRoot == null)
        {
            return(null);
        }
        this.DisposeGameObject(this.m_pkChatSprite);
        if (this.m_pkChatSprite == null)
        {
            this.m_pkChatSprite = CResources.ADDPrefabLoad(this.m_pkHeadUpRoot, NrTSingleton <UIDataManager> .Instance.FilePath + "Prefabs/CharEmoticonChat");
        }
        CharChatBillboardSprite component = this.m_pkChatSprite.GetComponent <CharChatBillboardSprite>();

        if (component == null)
        {
            return(null);
        }
        component.Init();
        return(component);
    }
예제 #2
0
 public void SetShowHeadUp(bool bShow)
 {
     if (this.m_pkHeadUpRoot == null)
     {
         return;
     }
     if (this.m_pkNameSprite != null)
     {
         CharNameBillboardSprite component = this.m_pkNameSprite.GetComponent <CharNameBillboardSprite>();
         if (component != null)
         {
             component.SetShowHide(bShow);
         }
     }
     if (this.m_pkChatSprite != null)
     {
         CharChatBillboardSprite component2 = this.m_pkChatSprite.GetComponent <CharChatBillboardSprite>();
         if (component2 != null)
         {
             component2.SetShowHide(bShow);
         }
     }
     if (this.m_pkCharStatus != null)
     {
         NkUtil.SetAllChildActive(this.m_pkCharStatus, bShow);
         NkUtil.SetShowHideRenderer(this.m_pkCharStatus, bShow, true);
     }
     if (this.m_pkGuildSprite != null)
     {
         CharNameBillboardSprite component3 = this.m_pkGuildSprite.GetComponent <CharNameBillboardSprite>();
         if (component3 != null)
         {
             component3.SetShowHide(bShow);
         }
     }
     this.m_bShowHeadUp = bShow;
     if (bShow)
     {
         this.SyncBillboardRotate(true);
     }
 }
예제 #3
0
    public bool MakeChat(eCharKindType chartype, string chatText, string guildName, bool ridestate, bool checkshowstatus)
    {
        if (chatText.Length <= 0)
        {
            return(false);
        }
        if (this.m_bCheckChatShowStatus && chartype == eCharKindType.CKT_NPC)
        {
            this.m_queueNpcTalk.Enqueue(chatText);
            return(false);
        }
        CharChatBillboardSprite charChatBillboardSprite = this.CreateChatSprite();

        if (charChatBillboardSprite == null)
        {
            return(false);
        }
        float num  = 2.2f;
        float num2 = 0f;

        charChatBillboardSprite.SetFontEffect(SpriteText.Font_Effect.HeadUp);
        switch (chartype)
        {
        case eCharKindType.CKT_USER:
        {
            string first = "[#FFFFFFFF]";
            charChatBillboardSprite.SetText(NrTSingleton <UIDataManager> .Instance.GetString(first, chatText));
            charChatBillboardSprite.SetPlaneKey("Win_T_BK", ref num2);
            if (ridestate)
            {
                num += 1.5f;
            }
            if (string.Empty != guildName)
            {
                num += 2f;
            }
            break;
        }

        case eCharKindType.CKT_SOLDIER:
        {
            string textColor = NrTSingleton <CTextParser> .Instance.GetTextColor("1002");

            charChatBillboardSprite.SetText(NrTSingleton <UIDataManager> .Instance.GetString(textColor, chatText));
            break;
        }

        case eCharKindType.CKT_MONSTER:
        {
            string textColor2 = NrTSingleton <CTextParser> .Instance.GetTextColor("1108");

            charChatBillboardSprite.SetText(textColor2 + chatText);
            break;
        }

        case eCharKindType.CKT_NPC:
        {
            char[] separator = new char[]
            {
                '+'
            };
            string[] array = chatText.Split(separator);
            if (this.m_bCheckChatShowStatus)
            {
                if (string.Empty != this.m_szColorText)
                {
                    for (int i = 0; i < array.Length; i++)
                    {
                        string @string = NrTSingleton <UIDataManager> .Instance.GetString(this.m_szColorText, array[i]);

                        this.m_queueNpcTalk.Enqueue(@string);
                    }
                }
                else
                {
                    for (int j = 0; j < array.Length; j++)
                    {
                        string string2 = NrTSingleton <UIDataManager> .Instance.GetString(NrTSingleton <CTextParser> .Instance.GetTextColor("1404"), array[j]);

                        this.m_queueNpcTalk.Enqueue(string2);
                    }
                }
            }
            else
            {
                if (2 <= array.Length)
                {
                    if (string.Empty != this.m_szColorText)
                    {
                        string string3 = NrTSingleton <UIDataManager> .Instance.GetString(this.m_szColorText, array[0]);

                        charChatBillboardSprite.SetText(string3);
                        for (int k = 1; k < array.Length; k++)
                        {
                            string string4 = NrTSingleton <UIDataManager> .Instance.GetString(this.m_szColorText, array[k]);

                            this.m_queueNpcTalk.Enqueue(string4);
                        }
                    }
                    else
                    {
                        string string5 = NrTSingleton <UIDataManager> .Instance.GetString(NrTSingleton <CTextParser> .Instance.GetTextColor("1404"), array[0]);

                        charChatBillboardSprite.SetText(string5);
                        for (int l = 1; l < array.Length; l++)
                        {
                            string string6 = NrTSingleton <UIDataManager> .Instance.GetString(NrTSingleton <CTextParser> .Instance.GetTextColor("1404"), array[l]);

                            this.m_queueNpcTalk.Enqueue(string6);
                        }
                    }
                }
                else if (string.Empty != this.m_szColorText)
                {
                    charChatBillboardSprite.SetText(this.m_szColorText + chatText);
                }
                else
                {
                    string textColor3 = NrTSingleton <CTextParser> .Instance.GetTextColor("1404");

                    charChatBillboardSprite.SetText(NrTSingleton <UIDataManager> .Instance.GetString(textColor3, chatText));
                }
                charChatBillboardSprite.SetPlaneKey("Win_T_BK", ref num2);
            }
            break;
        }
        }
        charChatBillboardSprite.ShowTextAndPlane(true, true);
        this.m_kTempVector3.x = 0f;
        this.m_kTempVector3.y = num + num2;
        this.m_kTempVector3.z = 0f;
        this.m_pkChatSprite.transform.localPosition = this.m_kTempVector3;
        this.m_fChatShowTime        = Time.time;
        this.m_bCheckChatShowStatus = checkshowstatus;
        this.SyncBillboardRotate(true);
        bool showHeadUp = this.IsCheckShowHeadUp(chartype);

        this.SetShowHeadUp(showHeadUp);
        return(true);
    }