效果图:
打包一个root.assetbundle文件,添加如下脚本:
public class LoadSence : MonoBehaviour
{
public Texture Background;
public Texture loading;
private float time=0;
public string url = null;
private WWW www;
void Awake()
{
//加载路径
if (Application.platform == RuntimePlatform.WindowsEditor)
{
url = "file:///" + Application.dataPath + "/StreamingAssets/WebPlayer/";
}
else if (Application.platform == RuntimePlatform.WindowsWebPlayer)
{
}
}
void Start()
{
StartCoroutine(LoadSenceAssetbundle());
}
void FixedUpdate()