public static void BuildAssetBundles()
    {
        string platformName = ResourceUtil.GetPlatformName();

        string outputPath = Path.Combine(ResourceUtil.AssetBundlesOutputPath, platformName);

        if ("Windows" == platformName)
        {
            outputPath = Path.Combine("Assets/StreamingAssets/", platformName);
        }

        if (!Directory.Exists(outputPath))
        {
            Directory.CreateDirectory(outputPath);
        }

        BuildPipeline.BuildAssetBundles(outputPath, BuildAssetBundleOptions.None, EditorUserBuildSettings.activeBuildTarget);
    }
示例#2
0
    protected override void InitManager()
    {
//#if UNITY_ANDROID
//        m_baseDownloadingURL = string.Format("{0}/{1}/", Application.streamingAssetsPath, ResourceUtil.GetPlatformName());
//        m_baseDownloadingURL = AssetBundles.AssetManager.BaseDownloadingURL;

//#else
//        m_baseDownloadingURL = string.Format("File:///{0}/{1}/", Application.streamingAssetsPath, ResourceUtil.GetPlatformName());
//#endif

        m_baseDownloadingURL = AssetBundles.AssetManager.BaseDownloadingURL;

        //m_baseLocalStorage = string.Format("{0}/{1}/", Application.streamingAssetsPath, ResourceUtil.GetPlatformName());
        m_baseLocalStorage = ResourcePath.GetBaseURL() + ResourceUtil.GetPlatformName() + "/";

        //m_baseDownloadingURL = ResourcePath.GetBaseURL();
        //UnloadAssetBundle(ResourceUtil.GetPlatformName());

        //string manifestPath = string.Format("{0}/{1}/{1}", Application.streamingAssetsPath, ResourceUtil.GetPlatformName());

        //AssetBundle bundle = AssetBundle.LoadFromFile(manifestPath);
        //m_assetBundleManifest = (AssetBundleManifest)bundle.LoadAsset("AssetBundleManifest", typeof(AssetBundleManifest));
        //bundle.Unload(false);
    }