コード例 #1
0
        static public void ToolsClearOutput()
        {
            bool checkClear = EditorUtility.DisplayDialog("ClearOutput Warning",
                                                          "Clear output assetbundles will force to rebuild all assetbundles, continue ?",
                                                          "Yes", "No");

            if (!checkClear)
            {
                return;
            }
            string outputPath = Path.Combine(AssetBundleConfig.AssetBundlesBuildOutputPath, AssetBundleUtility.GetCurPlatformName());

            GameUtility.SafeDeleteDir(outputPath);
            Debug.Log(string.Format("Clear {0} assetbundle output done!", AssetBundleUtility.GetCurPlatformName()));
        }
コード例 #2
0
        static public void ToolsClearPersistentAssets()
        {
            bool checkClear = EditorUtility.DisplayDialog("ClearPersistentAssets Warning",
                                                          "Clear persistent assetbundles will force to update all assetbundles that difference with streaming assets assetbundles, continue ?",
                                                          "Yes", "No");

            if (!checkClear)
            {
                return;
            }

            string outputPath = Path.Combine(Application.persistentDataPath, AssetBundleConfig.AssetBundlesFolderName);

            outputPath = Path.Combine(outputPath, AssetBundleUtility.GetCurPlatformName());
            GameUtility.SafeDeleteDir(outputPath);
            Debug.Log(string.Format("Clear {0} assetbundle persistent assets done!", AssetBundleUtility.GetCurPlatformName()));
        }
コード例 #3
0
        static public void ToolsClearStreamingAssets()
        {
            bool checkClear = EditorUtility.DisplayDialog("ClearStreamingAssets Warning",
                                                          "Clear streaming assets assetbundles will lost the latest player build info, continue ?",
                                                          "Yes", "No");

            if (!checkClear)
            {
                return;
            }
            string outputPath = Path.Combine(Application.streamingAssetsPath, AssetBundleConfig.AssetBundlesFolderName);

            outputPath = Path.Combine(outputPath, AssetBundleUtility.GetCurPlatformName());
            GameUtility.SafeDeleteDir(outputPath);
            AssetDatabase.Refresh();
            Debug.Log(string.Format("Clear {0} assetbundle streaming assets done!", AssetBundleUtility.GetCurPlatformName()));
        }
コード例 #4
0
        // unity editor启动和运行时调用
        static AssetBundleMenuItems()
        {
            // 1、模拟模式下在电脑上模拟手机资源更新过程,如果需要更新最新ab,需要手动构建;如果根本没有ab,则构建一次
            // 2、模拟模式下需要用到streamingAsset,没有资源则拷贝一次,之后总是从本地服务器下载ab到persistentDataPath
            var platformName   = AssetBundleUtility.GetCurPlatformName();
            var outputManifest = Path.Combine(AssetBundleConfig.AssetBundlesBuildOutputPath, platformName);

            outputManifest = Path.Combine(outputManifest, platformName);
            if (!File.Exists(outputManifest))
            {
                AssetBundleBuildScript.BuildAssetBundles();
            }
            var streamingManifest = Path.Combine(Application.streamingAssetsPath, AssetBundleConfig.AssetBundlesFolderName);

            streamingManifest = Path.Combine(streamingManifest, platformName);
            streamingManifest = Path.Combine(streamingManifest, platformName);
            if (!File.Exists(streamingManifest))
            {
                AssetBundleUtility.CopyPlatformAssetBundlesToStreamingAssets();
                AssetDatabase.Refresh();
            }
            LaunchAssetBundleServer.CheckAndDoRunning();
        }
コード例 #5
0
        static public void ListAssetbundleDependencis(bool isAll)
        {
            if (AssetBundleEditorHelper.HasValidSelection())
            {
                string localFilePath = AssetBundleUtility.GetBuildPlatformOutputPath(EditorUserBuildSettings.activeBuildTarget);
                localFilePath = Path.Combine(localFilePath, AssetBundleUtility.GetCurPlatformName());

                Object[] selObjs  = Selection.objects;
                var      depsList = AssetBundleEditorHelper.GetDependancisFormBuildManifest(localFilePath, selObjs, isAll);
                if (depsList == null)
                {
                    return;
                }

                depsList.Sort();
                string depsStr = string.Empty;
                int    i       = 0;
                foreach (string str in depsList)
                {
                    depsStr += string.Format("[{0}]{1}\n", ++i, str);
                }

                string selStr = string.Empty;
                i = 0;
                foreach (Object obj in selObjs)
                {
                    selStr += string.Format("[{0}]{1};", ++i, AssetDatabase.GetAssetPath(obj));
                }
                Debug.Log(string.Format("Selection({0}) directly depends on the following assetbundles:" +
                                        "\n-------------------------------------------\n" +
                                        "{1}" +
                                        "\n-------------------------------------------\n",
                                        selStr,
                                        depsStr));
            }
        }
コード例 #6
0
ファイル: Manifest.cs プロジェクト: lovoror/xlua-framework
 public Manifest()
 {
     AssetbundleName = AssetBundleUtility.GetCurPlatformName();
 }