我想通过先检查版本来下载资产捆绑包,如果有新版本,游戏会自动下载它并在此之后在本地使用它? 到目前为止,我所做的只是下载资产捆绑包,这是我的代码:
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;
public class loader : MonoBehaviour
{
private AssetBundleCreateRequest bundleRequest;
private UnityWebRequest request;
private void Start()
{
request = UnityWebRequestAssetBundle.GetAssetBundle("http://localhost/focus/level2",1);
request.SendWebRequest();
}
private void Update()
{
if (request.isDone)
{
AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(request);
SceneManager.LoadScene("SampleScene");
}
else
{
Debug.Log("not");
}
}
}