HybridCLR+Addressables热更新(3)Addressables配置和远程资源加载
类型选择Custom
Build路径写:ServerData/[BuildTarget] ([BuildTarget]为平台的环境变量)
Load路径写远程加载的服务器的地址:http://192.168.1.106:8080/[BuildTarget]
新建远程组
打包资源
生成的包在此路径下
将StandaloneWindows64文件夹放置到远端服务器:注意与Load路径写远程加载的服务器的地址一一对应
编写检查热更加载脚本
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
public class CheckAssetsUpdate : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
Addressables.LoadAssetAsync<GameObject>("Capsule").Completed += CheckAssetsUpdate_Completed;
}
private void CheckAssetsUpdate_Completed(AsyncOperationHandle<GameObject> obj)
{
var a = Instantiate(obj.Result);
}
// Update is called once per frame
void Update()
{
}
}
挂在脚本运行之后发现可以加载出来
原文地址:https://blog.csdn.net/weixin_53501436/article/details/144041672
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!