예제 #1
0
    private void ReqWebImageCallback(Texture2D txtr, object _param)
    {
        CharNameBillboardSprite component = this.m_pkGuildSprite.GetComponent <CharNameBillboardSprite>();

        if (component == null)
        {
            TsLog.LogWarning("!!!!!!!!!!!!!!!!!!!!! _GuildNameSprite GuildID  NOT ", new object[0]);
            return;
        }
        Transform transform = component.transform.FindChild("CharRank");

        if (transform != null)
        {
            DrawTexture drawTexture = (DrawTexture)transform.GetComponent(typeof(DrawTexture));
            if (txtr == null)
            {
                drawTexture.SetTexture(NrTSingleton <NewGuildManager> .Instance.GetGuildDefualtTexture());
            }
            else
            {
                drawTexture.SetTexture(txtr);
            }
            component.ShowTextAndPlane(true, false, true);
        }
        else
        {
            component.ShowTextAndPlane(true, false, false);
        }
    }
예제 #2
0
    public void MakeCharGuild(eCharKindType chartype, long i64GuildID, string strGuildName, bool bGuildWar, bool ridestate)
    {
        if (this.m_pkHeadUpRoot == null)
        {
            return;
        }
        this.DisposeGameObject(this.m_pkGuildSprite);
        if (this.m_pkGuildSprite == null)
        {
            this.m_pkGuildSprite = CResources.ADDPrefabLoad(this.m_pkHeadUpRoot, NrTSingleton <UIDataManager> .Instance.FilePath + "Prefabs/CharName");
            if (this.m_pkGuildSprite != null)
            {
                CharNameBillboardSprite component = this.m_pkGuildSprite.GetComponent <CharNameBillboardSprite>();
                if (component == null)
                {
                    TsLog.LogWarning("!!!!!!!!!!!!!!!!!!!!! m_pkGuildSprite NULL ", new object[0]);
                    return;
                }
                component.Init();
                if (strGuildName.Length != 0)
                {
                    string str = string.Empty;
                    if (bGuildWar)
                    {
                        str = NrTSingleton <CTextParser> .Instance.GetTextColor("1401");
                    }
                    else
                    {
                        str = NrTSingleton <CTextParser> .Instance.GetTextColor("2005");
                    }
                    component.SetText(str + strGuildName);
                    component.SetTextSize(12f);
                    this.MakeCharGuildRank(component);
                    if (i64GuildID != 0L)
                    {
                        string guildPortraitURL = NrTSingleton <NkCharManager> .Instance.GetGuildPortraitURL(i64GuildID);

                        WebFileCache.RequestImageWebFile(guildPortraitURL, new WebFileCache.ReqTextureCallback(this.ReqWebImageCallback), component);
                    }
                    else
                    {
                        Transform transform = component.transform.FindChild("CharRank");
                        if (transform != null)
                        {
                            DrawTexture drawTexture = (DrawTexture)transform.GetComponent(typeof(DrawTexture));
                            drawTexture.SetTexture(NrTSingleton <NewGuildManager> .Instance.GetGuildDefualtTexture());
                            component.ShowTextAndPlane(true, false, true);
                        }
                        else
                        {
                            component.ShowTextAndPlane(true, false, false);
                        }
                    }
                    this.m_kTempVector3.x = 0f;
                    this.m_kTempVector3.y = 2f;
                    this.m_kTempVector3.z = 0f;
                    this.m_pkGuildSprite.transform.localPosition = this.m_kTempVector3;
                }
                this.SyncBillboardRotate(true);
                bool showHeadUp = this.IsCheckShowHeadUp(chartype);
                this.SetShowHeadUp(showHeadUp);
            }
        }
    }
예제 #3
0
    public void MakeName(eCharKindType chartype, string strMark, string charname, bool ridestate)
    {
        bool flag = false;

        if (this.m_pkNameSprite == null)
        {
            flag = true;
        }
        CharNameBillboardSprite charNameBillboardSprite = this.CreateNameSprite();

        if (charNameBillboardSprite == null)
        {
            return;
        }
        float num = 0.3f;

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

            charNameBillboardSprite.SetText(textColor + charname);
            charNameBillboardSprite.SetTextSize(12f);
            if (ridestate)
            {
                num += 1.5f;
            }
            if (strMark.Length != 0)
            {
                this.MakeCharRank(strMark, charNameBillboardSprite, num);
                charNameBillboardSprite.ShowTextAndPlane(true, false, true);
            }
            else
            {
                charNameBillboardSprite.ShowTextAndPlane(true, false, false);
            }
            break;
        }

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

            charNameBillboardSprite.SetText(textColor2 + charname);
            charNameBillboardSprite.SetTextSize(12f);
            charNameBillboardSprite.ShowTextAndPlane(true, false, false);
            if (ridestate)
            {
                num += 1.5f;
            }
            break;
        }

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

            charNameBillboardSprite.SetText(textColor3 + charname);
            charNameBillboardSprite.SetTextSize(12f);
            charNameBillboardSprite.ShowTextAndPlane(true, false, false);
            break;
        }

        case eCharKindType.CKT_NPC:
        {
            string textColor4 = NrTSingleton <CTextParser> .Instance.GetTextColor("1404");

            charNameBillboardSprite.SetText(textColor4 + charname);
            charNameBillboardSprite.SetTextSize(12f);
            charNameBillboardSprite.ShowTextAndPlane(true, false, false);
            break;
        }

        case eCharKindType.CKT_OBJECT:
        {
            string textColor5 = NrTSingleton <CTextParser> .Instance.GetTextColor("1205");

            charNameBillboardSprite.SetText(textColor5 + charname);
            charNameBillboardSprite.SetTextSize(12f);
            charNameBillboardSprite.ShowTextAndPlane(true, true, false);
            break;
        }
        }
        if (flag)
        {
            this.m_kTempVector3.x = 0f;
            this.m_kTempVector3.y = num;
            this.m_kTempVector3.z = 0f;
            this.m_pkNameSprite.transform.localPosition = this.m_kTempVector3;
        }
        this.SyncBillboardRotate(true);
        bool showHeadUp = this.IsCheckShowHeadUp(chartype);

        this.SetShowHeadUp(showHeadUp);
    }