123456789101112131415161718192021222324252627282930 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class BundleRequest : AssetRequest
- {
- public string assetBundleName { get; set; }
- public AssetBundle assetBundle
- {
- get { return asset as AssetBundle; }
- internal set { asset = value; }
- }
- internal override void Load()
- {
- asset = AssetBundle.LoadFromFile(name);
- if (assetBundle == null)
- error = name + " LoadFromFile failed.";
- LoadState = AssetLoadState.Loaded;
- }
- internal override void Unload()
- {
- if (assetBundle == null)
- return;
- assetBundle.Unload(true);
- assetBundle = null;
- LoadState = AssetLoadState.Unload;
- }
- }
|