LoadGameMethod 网上资源加载更新:加载场景中另建协程用来加载;
public void LoadGameMethod()
{
StartCoroutine(start()); //Xlua网络加载
StartCoroutine(StartLoading_4(2)); //游戏场景协程加载(场景加载方法 )
}
IEnumerator start() //协程
{
UnityWebRequest request = UnityWebRequest.Get(@"http://10.0.101.23/Fish.lua.txt"); //网址及文件名
yield return request.Send();
string str = request.downloadHandler.text;
File.WriteAllText(@"F:5.6.1FishingJoyAssetBundlesfish.lua.txt", str); //下载到本地文件地址及文件名
}