public static void UnloadAssetBundle(string path) { if (!string.IsNullOrEmpty(path) && Application.isPlaying) { ulong hash = ResourceHash.FNVHashForPath(path); AssetBundleManager.Instance.Unload(hash); } }
public static AssetBundle LoadAssetBundle(string path) { AssetBundle result = null; if (!string.IsNullOrEmpty(path) && Application.isPlaying) { ulong hash = ResourceHash.FNVHashForPath(path); result = AssetBundleManager.Instance.Load(hash); } return(result); }
public static bool IsBundleExist(string path) { bool result = false; if (Application.isPlaying) { ulong hash = ResourceHash.FNVHashForPath(path); result = ResourceMainfest.IsAssetBundleResource(hash); } return(result); }
public static ulong GetPathHash(string path) { ulong hashId = ResourceHash.FNVHashForPath(path); if (IsAssetBundleResource(hashId) && Application.isPlaying) { return(hashId); } if (!m_hashToPath.ContainsKey(hashId)) { //string uniPath = ResourceHash.GetUniquePath(path); m_hashToPath.Add(hashId, path); } return(hashId); }