public void MakeCharRank(string key, CharNameBillboardSprite NameSprite, float fHeight) { Transform transform = NameSprite.transform.FindChild("CharRank"); DrawTexture drawTexture; if (transform == null) { drawTexture = (DrawTexture) new GameObject("CharRank") { transform = { parent = NameSprite.gameObject.transform, localPosition = new Vector3(0f, 0f, 0f), localScale = new Vector3(1f, 1f, 1f), localRotation = Quaternion.identity } }.AddComponent(typeof(DrawTexture)); } else { drawTexture = (DrawTexture)transform.GetComponent(typeof(DrawTexture)); } if (drawTexture != null) { drawTexture.SetTexture(key); float plane_Height = NameSprite.Get_Plane_Height(); drawTexture.SetSize(plane_Height, plane_Height); drawTexture.SetColor(new Color(1f, 1f, 1f, 1f)); drawTexture.transform.rotation = NameSprite.transform.rotation; Vector3 text_Scale = NameSprite.Get_Text_Scale(); drawTexture.transform.localScale = text_Scale; drawTexture.transform.localPosition = new Vector3((NameSprite.Get_Plane_Width() + plane_Height) * 0.5f * -text_Scale.x, 0f, 0f); } }
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); } }
public CharNameBillboardSprite CreateNameSprite() { if (this.m_pkHeadUpRoot == null) { return(null); } this.DisposeGameObject(this.m_pkNameSprite); if (this.m_pkNameSprite == null) { this.m_pkNameSprite = CResources.ADDPrefabLoad(this.m_pkHeadUpRoot, NrTSingleton <UIDataManager> .Instance.FilePath + "Prefabs/CharName"); } CharNameBillboardSprite component = this.m_pkNameSprite.GetComponent <CharNameBillboardSprite>(); if (component == null) { return(null); } component.Init(); return(component); }
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); } }
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); } } }
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); }