Unity 工具类 之 UnityWebRequest 常用功能封装
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Networking; /* 使用案例: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class TestScript : MonoBehaviour { public RawImage rawImage; public Text text; // Start is called before the first frame update void Start() { // 获取图片 UnityWebRequestMgr.Instance.GetTexture(Application.dataPath + "/TestAssets/Cat.jpg", SetTexttureToRawImage); // 获取文本 UnityWebRequestMgr.Instance.Get(Application.dataPath + "/TestAssets/TextFile.txt", (uwr) =>