Exemple #1
0
 static void checkWindow()
 {
     if (window == null)
     {
         window = (AssetBundlesCreatorEx)GetWindow(typeof(AssetBundlesCreatorEx));
     }
 }
Exemple #2
0
        public static void Execute(UnityEditor.BuildTarget target)
        {
            string platform = AssetBundlesCreatorEx.GetPlatformName(target);

            Execute(platform);
            AssetDatabase.Refresh();
        }
Exemple #3
0
        public static void Execute(UnityEditor.BuildTarget target)
        {
            string SavePath = AssetBundlesCreatorEx.GetPlatformPath(target);
            Object obj      = AssetDatabase.LoadAssetAtPath(SavePath + "VersionNum/VersionNum.xml", typeof(Object));

            BuildPipeline.BuildAssetBundle(obj, null, SavePath + "VersionNum/VersionNum.assetbundle", BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets | BuildAssetBundleOptions.DeterministicAssetBundle, target);

            AssetDatabase.Refresh();
        }
        public static void Execute(UnityEditor.BuildTarget target)
        {
            string SavePath = AssetBundlesCreatorEx.GetPlatformPath(target);

            Object[] targets = Selection.GetFiltered(typeof(Object), SelectionMode.DeepAssets);
            // 当前选中的资源列表
            foreach (Object o in targets)
            {
                string path = AssetDatabase.GetAssetPath(o);

                // 过滤掉meta文件
//                if(path.Contains(".meta"))
//                    continue;

                path  = SavePath + ConvertToAssetBundleName(path);
                path  = path.Substring(0, path.LastIndexOf('.'));
                path += ".assetbundle";

                BuildPipeline.BuildAssetBundle(o, null, path, BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets, target);
            }

            AssetDatabase.Refresh();
        }