Ejemplo n.º 1
0
 public static void UnloadAssetBundle(string path)
 {
     if (!string.IsNullOrEmpty(path) && Application.isPlaying)
     {
         ulong hash = ResourceHash.FNVHashForPath(path);
         AssetBundleManager.Instance.Unload(hash);
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }