public static bool IsFilterSceneRes(string dep, string file)
    {
        if (string.IsNullOrEmpty(dep) || string.Equals(dep, file))
        {
            return(true);
        }

        // 只记录贴图、动作、音效资源;
        string extension = BuildCommon.GetExtension(dep);

        if (BuildCommon.IsTextureAsset(dep, extension) ||
            BuildCommon.IsAudioAsset(dep, extension) ||
            BuildCommon.IsShaderAsset(dep, extension)
            //|| BuildCommon.IsBigModelAsset(dep,extension)
            )
        {
            return(false);
        }

        return(true);
    }
示例#2
0
    //[MenuItem("Bundles/DisposeAllFbxs2")]
    //public static void DisposeAllFbxs2()
    //{
    //    BuildCommon.ChangeMaterial(Selection.activeGameObject);
    //}

    //[MenuItem("Bundles/DisposeAllFbxs")]
    //public static void DisposeAllFbxs()
    //{
    //    List<string> fbxs = EditorCommon.GetAllFiles("Assets/Arts/", "*.fbx");
    //    Debug.LogFormat("{0}", fbxs.Count);

    //    for( int i=0; i< fbxs.Count; i++ )
    //    {
    //        string fbxPath = fbxs[i];
    //        GameObject gObj = AssetDatabase.LoadAssetAtPath(fbxPath, typeof(GameObject)) as GameObject;
    //        BuildCommon.ChangeMaterial(gObj);

    //        PackAssetBundleUtlis.ShowProgress(i, fbxs.Count, "处理Fbx", "处理Fbx");

    //        if (i % 50 == 0)
    //        {
    //            AssetDatabase.SaveAssets();
    //            AssetDatabase.Refresh();
    //        }
    //    }
    //    EditorUtility.ClearProgressBar();
    //}

    public static int GetAssetBundleBuildPriority(AssetBundleBuild build)
    {
        if (build.assetNames == null || build.assetNames.Length < 1)
        {
            return(-1);
        }

        string path = build.assetNames[0];

        if (string.IsNullOrEmpty(path))
        {
            return(-1);
        }

        string extension = System.IO.Path.GetExtension(path);

        extension = extension.ToLower();

        if (string.Equals(extension, ".unity"))
        {
            return(100);
        }

        if (BuildCommon.IsShaderAsset(path, extension))
        {
            return(0);
        }

        if (BuildCommon.IsTextureAsset(path, extension, false))
        {
            return(1);
        }

        if (BuildCommon.IsAnimAsset(path, extension))
        {
            return(2);
        }

        if (BuildCommon.IsAudioAsset(path, extension))
        {
            return(3);
        }

        if (BuildCommon.IsMaterialAsset(path, extension))
        {
            return(4);
        }

        if (BuildCommon.IsModelAsset(path, extension))
        {
            return(5);
        }

        if (BuildCommon.IstTTFFontAsset(path, extension))
        {
            return(6);
        }

        if (BuildCommon.IsUIFontAsset(path, extension))
        {
            return(21);
        }

        if (BuildCommon.IsAtlasAsset(path, extension))
        {
            return(22);
        }

        if (BuildCommon.IsPrefabAsset(path, extension))
        {
            return(99);
        }
        //Debug.Log(path);
        return(20);
    }