public static NkUtil.REQUEST_CHAR_TEXTURE_INFO RequestCharTexture(eCharImageType type, int kind, int solgrade, NkUtil.RequestCharPortraitCallback callbackDelegate, string costume = "") { NkUtil.REQUEST_CHAR_TEXTURE_INFO result = default(NkUtil.REQUEST_CHAR_TEXTURE_INFO); string text = MsgHandler.HandleReturn <string>("PortraitFileName", new object[] { kind, solgrade }); if (string.Empty == text) { return(result); } if (!string.IsNullOrEmpty(costume)) { string text2 = MsgHandler.HandleReturn <string>("PortraitCostumeFileName", new object[] { kind, solgrade, costume }); if (!string.IsNullOrEmpty(text2)) { text = text2; } } if (type == eCharImageType.SMALL) { result._imageKey = text + "_64"; } else if (type == eCharImageType.MIDDLE) { result._imageKey = text + "_256"; } else if (type == eCharImageType.LARGE) { if (UIDataManager.IsUse256Texture()) { result._imageKey = text + "_256"; } else { result._imageKey = text + "_512"; } } result._tex2D = NrTSingleton <UIImageBundleManager> .Instance.GetTexture(result._imageKey); if (result._tex2D != null) { return(result); } object[] callBackParam = new object[] { callbackDelegate, result._imageKey }; NrTSingleton <UIImageBundleManager> .Instance.RequestCharImageCustomParam(result._imageKey, type, new PostProcPerItem(NkUtil.CharPortraitBundleCallback), callBackParam); return(result); }
private string _ImagePath(eCharImageType type) { string result = string.Empty; if (type == eCharImageType.SMALL) { result = "UI/Soldier/64"; } else if (type == eCharImageType.MIDDLE) { result = "UI/Soldier/256"; } else if (type == eCharImageType.LARGE) { if (UIDataManager.IsUse256Texture()) { result = "UI/Soldier/256"; } else { result = "UI/Soldier/512"; } } return(result); }
public void SetTextureEvent(eCharImageType type, int kind, int solgrade) { this.SetTexture(type, kind, solgrade, string.Empty); UIListItemContainer uIListItemContainer = base.gameObject.AddComponent <UIListItemContainer>(); if (uIListItemContainer == null) { return; } GameObject gameObject = new GameObject("EventMark"); if (gameObject == null) { return; } DrawTexture drawTexture = gameObject.AddComponent <DrawTexture>(); if (drawTexture != null) { drawTexture.SetUseBoxCollider(false); drawTexture.gameObject.layer = GUICamera.UILayer; drawTexture.SetTexture("Win_I_Notice05"); drawTexture.SetSize(this.width * 0.45f, this.height * 0.45f); drawTexture.SetAnchor(SpriteRoot.ANCHOR_METHOD.UPPER_LEFT); uIListItemContainer.MakeChild(drawTexture.gameObject); drawTexture.gameObject.transform.localPosition = new Vector3(this.width * 0.8f, this.height * 0.1f); drawTexture.Visible = true; } }
public void SetTexture(eCharImageType type, int kind, int solgrade, string costume = "") { this.imageKey = string.Empty; this.reserve = false; string text = MsgHandler.HandleReturn <string>("PortraitFileName", new object[] { kind, solgrade }); if (string.Empty == text) { return; } if (!string.IsNullOrEmpty(costume)) { string text2 = MsgHandler.HandleReturn <string>("PortraitCostumeFileName", new object[] { kind, solgrade, costume }); if (!string.IsNullOrEmpty(text2)) { text = text2; } } this.m_etype = type; if (type == eCharImageType.SMALL) { this.imageKey = text + "_64"; } else if (type == eCharImageType.MIDDLE) { this.imageKey = text + "_256"; } else if (type == eCharImageType.LARGE) { if (UIDataManager.IsUse256Texture()) { this.imageKey = text + "_256"; } else { this.imageKey = text + "_512"; } } Texture2D texture = NrTSingleton <UIImageBundleManager> .Instance.GetTexture(this.imageKey); if (null != texture) { base.SetTexture(texture); this.reserve = true; } else { NrTSingleton <UIImageBundleManager> .Instance.RequestCharImage(this.imageKey, type, new PostProcPerItem(this.SetImage)); } }
public void SetSolImageTexure(eCharImageType type, int charkind, int solgrade, int level) { this.SetSolImageTexure(type, charkind, solgrade); this.downText.Visible = true; this.downText.SetAnchor(SpriteText.Anchor_Pos.Upper_Left); this.downText.SetAlignment(SpriteText.Alignment_Type.Left); this.downText.spriteText.gameObject.transform.localPosition = new Vector3(2f, this.height - this.fontSize - 2f, -0.02f); this.downText.Text = NrTSingleton <UIDataManager> .Instance.GetString("Lv ", level.ToString()); }
public void RequestCharImage(string imageKey, eCharImageType type, PostProcPerItem callbackDelegate) { string arg = this._ImagePath(type); string str = string.Format("{0}/{1}", arg, imageKey + NrTSingleton <UIDataManager> .Instance.AddFilePath); WWWItem wWWItem = Holder.TryGetOrCreateBundle(str + Option.extAsset, MsgHandler.HandleReturn <string>("UIBundleStackName", new object[0])); wWWItem.SetItemType(ItemType.USER_ASSETB); wWWItem.SetCallback(callbackDelegate, imageKey); TsImmortal.bundleService.RequestDownloadCoroutine(wWWItem, DownGroup.RUNTIME, true); }
public void SetSolImageTexure(eCharImageType type, NkListSolInfo solInfo, bool bShowEventMark) { if (solInfo == null) { return; } this.SetSolImageTexure(type, solInfo.SolCharKind, solInfo.SolGrade, solInfo.SolInjuryStatus, solInfo); this.SolOtherInfo(solInfo); this.SolEventMark(bShowEventMark); }
public void SetTextureFromUISoldierBundle(eCharImageType type, string bunldname) { string text = "UI/Soldier"; string text2 = string.Empty; string text3 = string.Empty; if (type == eCharImageType.SMALL) { text2 = "64"; } else if (type == eCharImageType.MIDDLE) { text2 = "256"; } else if (type == eCharImageType.LARGE) { if (UIDataManager.IsUse256Texture()) { text2 = "256"; } else { text2 = "512"; } } text3 = string.Format("{0}/{1}/{2}_{3}", new object[] { text, text2, bunldname, text2 }); if (text3 != string.Empty) { this.SetTextureFromBundle(text3); } }
public void SetTextureEffect(eCharImageType type, int kind, int solgrade, string costumePortraitPath = "") { this.SetTexture(type, kind, solgrade, costumePortraitPath); string s = MsgHandler.HandleReturn <string>("GetLegendTypeToString", new object[] { kind, solgrade }); short num = short.Parse(s); if (0 < num) { Transform y = base.transform.FindChild(NrTSingleton <UIDataManager> .Instance.AttachEffectKeyName); if (null == y && !this.bHaveEffect) { if (type == eCharImageType.SMALL) { NrTSingleton <FormsManager> .Instance.RequestAttachUIEffect("Effect/Instant/fx_legendhero_ui" + NrTSingleton <UIDataManager> .Instance.AddFilePath, this, base.GetSize()); } else { NrTSingleton <FormsManager> .Instance.RequestAttachUIEffect("Effect/Instant/fx_herolegendblg_ui" + NrTSingleton <UIDataManager> .Instance.AddFilePath, this, base.GetSize()); } this.AddGameObjectDelegate(new EZGameObjectDelegate(NrTSingleton <UIDataManager> .Instance.ResizeEffect)); this.bHaveEffect = true; } } else { Transform transform = base.transform.FindChild(NrTSingleton <UIDataManager> .Instance.AttachEffectKeyName); if (null != transform) { UnityEngine.Object.Destroy(transform.gameObject); this.bHaveEffect = false; } } }
public void SetSolImageTexure(eCharImageType type, int charkind, int solgrade) { this.SetSolImageTexure(type, charkind, solgrade, false, null); }
public void SetSolImageTexure(eCharImageType type, int charkind, int solgrade, bool injury, NkListSolInfo solInfo) { this.reserve = false; this.imageKey = string.Empty; string text = MsgHandler.HandleReturn <string>("PortraitFileName", new object[] { charkind, solgrade }); if (string.Empty == text) { Debug.LogError(string.Concat(new object[] { "fail find SolImage = ", charkind.ToString(), " SolGrade = ", solgrade, " ", Time.time })); this.ClearData(); return; } if (solInfo != null && !string.IsNullOrEmpty(solInfo.SolCostumePortraitPath)) { string text2 = MsgHandler.HandleReturn <string>("PortraitCostumeFileName", new object[] { charkind, solgrade, solInfo.SolCostumePortraitPath }); if (!string.IsNullOrEmpty(text2)) { text = text2; } } this.SolInjuryStatus(injury); this.m_etype = type; if (type == eCharImageType.SMALL) { this.imageKey = text + "_64"; } else if (type == eCharImageType.MIDDLE) { this.imageKey = text + "_256"; } else if (type == eCharImageType.LARGE) { if (UIDataManager.IsUse256Texture()) { this.imageKey = text + "_256"; } else { this.imageKey = text + "_512"; } } Texture2D texture = NrTSingleton <UIImageBundleManager> .Instance.GetTexture(this.imageKey); if (null != texture) { this.DrawHero(texture); this.reserve = true; } else { NrTSingleton <UIImageBundleManager> .Instance.RequestCharImage(this.imageKey, type, new PostProcPerItem(this.SetCharImage)); } string s = MsgHandler.HandleReturn <string>("GetLegendTypeToString", new object[] { charkind, solgrade }); short num = short.Parse(s); if (0 < num) { Transform y = base.transform.FindChild(NrTSingleton <UIDataManager> .Instance.AttachEffectKeyName); if (null == y && !this.bHaveEffect) { if (type == eCharImageType.SMALL) { NrTSingleton <FormsManager> .Instance.RequestAttachUIEffect("Effect/Instant/fx_legendhero_ui" + NrTSingleton <UIDataManager> .Instance.AddFilePath, this, base.GetSize()); } else { NrTSingleton <FormsManager> .Instance.RequestAttachUIEffect("Effect/Instant/fx_herolegendblg_ui" + NrTSingleton <UIDataManager> .Instance.AddFilePath, this, base.GetSize()); } this.AddGameObjectDelegate(new EZGameObjectDelegate(NrTSingleton <UIDataManager> .Instance.ResizeEffect)); this.bHaveEffect = true; } } else { Transform transform = base.transform.FindChild(NrTSingleton <UIDataManager> .Instance.AttachEffectKeyName); if (null != transform) { UnityEngine.Object.Destroy(transform.gameObject); this.bHaveEffect = false; } } if ("true" == MsgHandler.HandleReturn <string>("CharKindIsATB", new object[] { charkind, 128L })) { this.upText.Visible = false; } else { UIBaseInfoLoader uIBaseInfoLoader = MsgHandler.HandleReturn <UIBaseInfoLoader>("GetSolGradeImg", new object[] { charkind, solgrade }); if (null != this.downText && null != this.upText) { if (uIBaseInfoLoader != null) { this.upText.Visible = true; this.downText.Visible = false; this.upText.SetSize(uIBaseInfoLoader.UVs.width, uIBaseInfoLoader.UVs.height); this.upText.SetTexture(uIBaseInfoLoader); if (0 < num) { this.upText.gameObject.transform.localPosition = new Vector3(-6f, -(this.height - uIBaseInfoLoader.UVs.height + 6f), -0.02f); } else { this.upText.gameObject.transform.localPosition = new Vector3(2f, -(this.height - uIBaseInfoLoader.UVs.height - 2f), -0.02f); } this.upText.DeleteSpriteText(); } else { this.upText.Visible = false; this.downText.Visible = false; } } } }
public void SetSolImageTexure(eCharImageType type, NkListSolInfo solInfo) { this.SetSolImageTexure(type, solInfo, false); }