예제 #1
0
 public static void UnloadAssetBundle(string path)
 {
     if (!string.IsNullOrEmpty(path) && Application.isPlaying)
     {
         ulong hash = ResourceHash.FNVHashForPath(path);
         AssetBundleManager.Instance.Unload(hash);
     }
 }
예제 #2
0
        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);
        }
예제 #3
0
        public static bool IsBundleExist(string path)
        {
            bool result = false;

            if (Application.isPlaying)
            {
                ulong hash = ResourceHash.FNVHashForPath(path);
                result = ResourceMainfest.IsAssetBundleResource(hash);
            }

            return(result);
        }
예제 #4
0
        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);
        }