您当前的位置: 首页 >  服务器

苍狼王unity学院

暂无认证

  • 4浏览

    0关注

    305博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

自己的C#框架_第9篇之加载WEB服务器端的unity模型AB包

苍狼王unity学院 发布时间:2019-05-20 09:25:37 ,浏览量:4

 1、   
            StartCoroutine((LoadAssetBundle(ServerAPI.serverAddress + ServerAPI.getImage + "?fileName=chengke.assetbundle", "chengke")));

/// 加载模型。
public static IEnumerator LoadAssetBundle(string url, string GoName)
{
    UnityWebRequest request = UnityWebRequestAssetBundle.GetAssetBundle(url);
    yield return request.SendWebRequest();
    AssetBundle ab = DownloadHandlerAssetBundle.GetContent(request);
    //使用里面的资源
    GameObject wallPrefab = ab.LoadAsset(GoName);
    GameObject.Instantiate(wallPrefab);
    ab.Unload(true);
}
关注
打赏
1665389160
查看更多评论
立即登录/注册

微信扫码登录

0.0793s