赞
踩
Unity关于本地加载图片的有2种,一种使用webrequest发送请求发送数据将得到的数据转换成Texture2d,最后转换成sprite,第二种方法是使用读取文本文件方法
将图片当成文件来读取,然后转换成,下边附上我的代码
[RequireComponent(typeof(UnityEngine.UI.Image))] public class LoadMyUI : MonoBehaviour { public string path = " "; private string Currentpath = " "; private Image thisImage; public string MySaveTextName = " "; private string SaveImageTxtName = " "; private TagIsDepress Tag; private bool LoadingEnd = false; // Start is called before the first frame update void Start() { thisImage = this.GetComponent<Image>(); //thisImage.gameObject.SetActive(false); Currentpath = Path.Combine(Application.persistentDataPath, path); Debug.Log($"PathpersistentDataPathYouSEE:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。