private void LoadTex(AssetBundleRequest abr, System.Object param) { if (abr == null) { return; } textures = abr.asset as StringContentHolder; ResLoader.HelpLoadAsset(assetBundle, "rendererobject", LoadCallback, null, typeof(GameObject)); }
private void LoadBone(AssetBundleRequest abr, System.Object param) { if (abr == null) { return; } boneName = abr.asset as StringContentHolder; if (pack) { ResLoader.HelpLoadAsset(assetBundle, "textures", LoadTex, null, typeof(StringContentHolder)); } else { ResLoader.HelpLoadAsset(assetBundle, "rendererobject", LoadCallback, null, typeof(GameObject)); } }
public void OnDestroy() { try { if (assetBundle != null) { assetBundle.Unload(true); assetBundle = null; } Object.Destroy(gameObject); gameObject = null; ResLoader.Unload(goAsset); boneName = null; textures = null; ResLoader.RemoveAssetCacheByName(name, true, true); } catch (System.Exception e) { Debug.LogError("unload asset failed->" + e.ToString()); } }