UnityWebRequest获取文本文件,并写入到固定目录

 IEnumerator LoadResourceCorotine()
    {
        UnityWebRequest request = UnityWebRequest.Get(@"http://localhost/fish.lua.txt");
        yield return request.SendWebRequest();
        string str = request.downloadHandler.text;
        File.WriteAllText(@"D:\PlayerGamePackage\fish.lua.txt", str);
    }

 

你可能感兴趣的:(Unity)