using Blue; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class XunJianUIItem_Texture : MonoBehaviour,IController { public void GetSprite(Dictionary byteDic, int mItemID, int Index) { //Debug.LogError($"mItemID:{mItemID}, Index:{Index}"); LangChaoMinIo.Instance.getFile(this.GetService().InspectionInfo.id, mItemID.ToString(), Index, Texture2D => { if (Texture2D != null) { byteDic.Add(Index, new ByteClass() { upload = false, bytes = Texture2D.EncodeToPNG() }); Sprite sprite = Sprite.Create(Texture2D, new Rect(0, 0, Texture2D.width, Texture2D.height), Vector2.zero); sprite.name = Index.ToString(); GetComponent().sprite = sprite; } }); } }