Esempio n. 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);
    }
Esempio n. 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);
            }
        }
    }
Esempio n. 3
0
    public static T ADDPrefab <T>(GameObject _Parent, string _PfName) where T : Component
    {
        GameObject gameObject = CResources.ADDPrefabLoad(_Parent, _PfName);

        return(gameObject.GetComponent <T>());
    }