unity学习 5.x解包
Posted gasor
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了unity学习 5.x解包相关的知识,希望对你有一定的参考价值。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class bundleloadasset : MonoBehaviour {
// Use this for initialization
void Start () {
StartCoroutine(Load());
}
// Update is called once per frame
void Update () {
}
IEnumerator Load()
{
WWW www = new WWW("file:///D:/MyUnity/assetdatabase3d/Assets/Bundle/2000.assetbundle");
//网上加载资源:WWW www = new WWW("file:///" + Application.streamingAssetsPath + "2000.assetbundle");
yield return www;
AssetBundle bundle = www.assetBundle;
AssetBundleRequest request= bundle.LoadAssetAsync("Assets/New Material.mat", typeof(Material));
yield return request;
GameObject.Find("/Cube").GetComponent<Renderer>().material = request.asset as Material;
}
}
以上是关于unity学习 5.x解包的主要内容,如果未能解决你的问题,请参考以下文章