示例#1
0
 public string GetHash()
 {
     if (type == AssetType.Builtin)
     {
         return("0000000000");
     }
     else
     {
         return(AssetBundleUtils.GetFileHash(file.FullName));
     }
 }
示例#2
0
        /// <summary>
        /// Texture
        /// AudioClip
        /// Mesh
        /// Model
        /// Shader
        /// 这些类型的Asset的一配置是放在.meta中的,所以要监视它们的变化
        /// 而在5x中系统会自己处理的,不用管啦
        /// </summary>
        void LoadMetaHashIfNecessary()
        {
            bool needLoad = false;

            if (typeof(Texture).IsInstanceOfType(asset) ||
                typeof(AudioClip).IsInstanceOfType(asset) ||
                typeof(Mesh).IsInstanceOfType(asset) ||
                typeof(Shader).IsInstanceOfType(asset))
            {
                needLoad = true;
            }

            if (!needLoad)
            {
                AssetImporter importer = AssetImporter.GetAtPath(assetPath);
                needLoad = typeof(ModelImporter).IsInstanceOfType(importer);
            }

            if (needLoad)
            {
                _metaHash = AssetBundleUtils.GetFileHash(assetPath + ".meta");
            }
        }