public static void ChangeUITextureFromFileASync(UITexture uiTex, string texname, bool resize = true, Action callback = null) { NGUIUtil.LoadTextureAsync(uiTex, texname, callback); if (resize) { uiTex.MakePixelPerfect(); } }
private void ShowItemIcon() { if (this.data != null) { this.soulId = this.data.soulId; string evolveItemIconPathByID = ClassSingleton <EvolutionData> .Instance.GetEvolveItemIconPathByID(this.soulId); this.lbNum.text = this.data.num; NGUIUtil.LoadTextureAsync(this.texSoul, evolveItemIconPathByID, new Action(this.DispItemNum)); } }
private void LoadIcon(GameWebAPI.RespDataMA_ChipM.Chip data = null, int texSizeWidth = -1, int texSizeHeight = -1) { this.isLoad = true; string texname = (data == null) ? "ChipThumbnail/Chip_Empty" : data.GetIconPath(); NGUIUtil.LoadTextureAsync(this.iconTexture, texname, delegate { this.isLoad = false; if (this != null && texSizeWidth > 0 && texSizeHeight > 0) { float x = (float)texSizeWidth / (float)this.defaultTexSizeWidth; float y = (float)texSizeHeight / (float)this.defaultTexSizeHeight; this.transform.localScale = new Vector3(x, y, 1f); } }); }