All Projects → sNaticY → assetUpdater-core

sNaticY / assetUpdater-core

Licence: MIT, Unknown licenses found Licenses found MIT LICENSE Unknown LICENSE.meta
AssetUpdater is a Unity plugin which helps developers build assetbundles and download it easily

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to assetUpdater-core

Appupdater
🚀 AppUpdater一个专注于App更新,一键傻瓜式集成App版本升级的轻量开源库。(无需担心通知栏适配;无需担心重复点击下载;无需担心App安装等问题;这些AppUpdater都已帮您处理好。)
Stars: ✭ 406 (+968.42%)
Mutual labels:  download, update
Githubupdates
Cocoa framework to install application updates from GitHub releases.
Stars: ✭ 393 (+934.21%)
Mutual labels:  download, update
Port-Able-Suite
🌐 Manager for portable applications
Stars: ✭ 35 (-7.89%)
Mutual labels:  download, update
Update4j
Create your own auto-update framework
Stars: ✭ 497 (+1207.89%)
Mutual labels:  download, update
Backdoor
A backdoor that runs on Linux and Windows
Stars: ✭ 36 (-5.26%)
Mutual labels:  download
instagram json viewer
Transforms Instagram's *.json / backup data - that you get via the Data Download Tool - to a readable format!
Stars: ✭ 41 (+7.89%)
Mutual labels:  download
anghamify
Anghami Downloader | Download Anghami songs with full meta-tags.
Stars: ✭ 22 (-42.11%)
Mutual labels:  download
goes2go
Download and process GOES-16 and GOES-17 data from NOAA's archive on AWS using Python.
Stars: ✭ 77 (+102.63%)
Mutual labels:  download
Vividl
Modern Windows GUI for youtube-dl/ yt-dlp
Stars: ✭ 189 (+397.37%)
Mutual labels:  download
download-image
No save as prompts! Extension to add a context menu item which allows you to directly download an image!
Stars: ✭ 26 (-31.58%)
Mutual labels:  download
m3u8-downloader
chrome插件,支持监控和下载:m3u8流媒体、视频、音频
Stars: ✭ 54 (+42.11%)
Mutual labels:  download
node-wetransfert
Download wetransfert content with nodeJS
Stars: ✭ 16 (-57.89%)
Mutual labels:  download
FiniteStateMachine
This project is a finite state machine designed to be used in games.
Stars: ✭ 45 (+18.42%)
Mutual labels:  update
ngDownloader
📹 🎥 Now Download videos from any website including YouTube, Facebook, Udemy etc without ads.
Stars: ✭ 47 (+23.68%)
Mutual labels:  download
ytdl
youtube download cli in rust.
Stars: ✭ 22 (-42.11%)
Mutual labels:  download
MusicDownloader
It is a tool to download the music files such as .mp3 from netease cloud
Stars: ✭ 63 (+65.79%)
Mutual labels:  download
rsync
gokrazy rsync
Stars: ✭ 308 (+710.53%)
Mutual labels:  download
AssetBundleManager
This script for easily use AssetBundle.
Stars: ✭ 79 (+107.89%)
Mutual labels:  assetbundle
downloader
Async rate-limited downloading service
Stars: ✭ 18 (-52.63%)
Mutual labels:  download
angular-downloader
Angular Downloader is an angularjs directive that enables you to manage browser download - https://720kb.github.io/angular-downloader
Stars: ✭ 16 (-57.89%)
Mutual labels:  download

AssetUpdater

AssetUpdater 为开发者提供了方便的生成以及下载 Assetbundle 的工作流。借助该插件,开发者可以一键式的生成 Assetbundle 并在自己的项目中使用几行代码来完成从特定链接下载需要被更新的所有 Assetbundle。

License License

安装

  • 方法一:在 Unity 工程 Assets 目录下新建文件夹 AssetUpdater, 下载 Zip 后将所有文件解压至该文件夹即可。
  • 方法二:直接下载 Release 最新版本的 AssetUpater.unitypackage 并将其导入工程即可
  • 方法三:在 Unity 工程中添加 git submodule 并设置相对路径为 Assets/AssetUpdater。

快速入门

该插件的主要功能分为 ”生成 Assetbundle“ 和 ”下载 Assetbundle“ 两部分。

生成 Assetbundle

导入插件后单击 Unity 菜单栏中的 Window/AssetUpdater Settings即可在 Inspector 中显示设置面板。如下图所示:

AssetUpdater settings

当你为某些文件设置assetbundle name后,该 assetbundle 就会出现在Local BundlesRemote Bundles中,其中Local Bundles中的 assetbundle 会在生成后被额外复制到streamingassets目录下。在打包时随安装包发布,并生成独特的 versionfile 做记录,防止资源重复下载。

选择平台后点击最下方Build Assetbundles按钮即可生成 Assetbundle 及其版本信息文件。其中原始的 assetbundle 及其 assetbundlemanifest 文件会被放置在与 Unity 工程中Assets目录同级的AssetBundlePool文件夹,并将 assetbundle 文件按照原始目录结构复制到与 Unity 工程中Assets目录同级的AssetBundleServer文件夹中,同时在该文件夹生成版本信息文件,版本信息文件默认文件名为versionfile.bytesAssetBundleServer文件夹中的全部内容放置在你的 http 文件服务器中供客户端下载即可。

如需要本地测试则可以在AssetBundleServer目录运行sudo python -m SimpleHTTPServer 80命令,即可开启本地 http 文件服务,访问 http://localhost 即可下载文件。

下载 Assetbundle

AssetUpdater Seetings中设置remote url为你的 http 文件服务器地址,如需本地测试则设置为 http://localhost 即可。

在 Unity 工程中添加如下代码。

using Meow.AssetUpdater.Core;
using UnityEngine;

public class TestScript : MonoBehaviour
{
	// Use this for initialization
	IEnumerator Start()
	{
		yield return MainUpdater.LoadAllVersionFiles();
		yield return MainUpdater.UpdateFromStreamingAsset();
		yield return MainUpdater.UpdateFromRemoteAsset();
	}	
}

MainUpdater.LoadAllVersionFiles()会加载本地 streamingAssetPath 和 persistentDataPath (如果不存在则会自动生成一个)以及 remote url 中所有的 versionfile。

MainUpdater.UpdateFromStreamingAsset()则会对比 persistentDataPath 和 streamingAssetPath 中的 versionfile 并将不存在或版本更新的 assetbundle 文件复制至 persistentDataPath 中。复制后将会更新 persistentDataPath 对应的 versionfile 中的信息并将其写入磁盘。每复制完一个 assetbundle 并将其写入磁盘后会立即更新 versionfile。因此即使下载过程中断也不会导致已下载的 assetbundle 下次启动时被重复下载。

MainUpdater.UpdateFromRemoteAsset()会对比 persistentDataPath 和 remote Url 中的 versionfile,将不存在或版本更新的 assetbundle 文件复制至 persistentDataPath 中。在生成 assetbundle 时勾选至 Local Bundles 的 assetbundle 文件在上一步已被更新至 persistentDataPath 因此不会重复下载,除非 remote 中的 assetbundle 版本更新。每更新完一个 assetbundle 并将其写入磁盘后会立即更新 versionfile。因此即使下载过程中断也不会导致已下载的 assetbundle 下次启动时被重复下载。

主要接口

Meow.AssetUpdater.Core.MainUpdater

/// <summary>
/// 初始化 AssetUpdater 全局设置,可用于覆盖 AssetUpdater Settings 中的设置。
/// </summary>
/// <param name="remoteUrl">远程 Assetbundle 服务器地址</param>
/// <param name="relativePath">放置 assetbundle 及 versionfile 的相对路径</param>
/// <param name="versionFileName">versionfile 的命名,默认为 "versionfile.bytes"</param>
public static void Initialize(string remoteUrl, string relativePath, string versionFileName);
  
/// <summary>
/// 下载位于远程服务器、persistentDataPath 以及 streamingAssetPath 中的所有 versionfile,
/// 用于对比文件状态生成下载列表准备下载
/// </summary>
/// <returns>返回 IEnumrator 可在 coroutine 中通过 "yield return" 调用以实现异步操作</returns>
public static IEnumerator LoadAllVersionFiles();

/// <summary>
/// 从 StreamingAssetPath 或 RemoteUrl 下载 assetbundle 到 persistentDataPath,
/// 之所以分成两个函数是因为只有 UpdateFromRemoteAsset() 会消耗流量。因此开发者可以考虑
/// 通过返回的 UpdateOperation 中的对象进行 UI 提示等。
/// </summary>
/// <returns>返回 UpdateOperation 对象提供当前 Update 信息,如下载进度,剩余文件大小等</returns>
public static UpdateOperation UpdateFromStreamingAsset();
public static UpdateOperation UpdateFromRemoteAsset();

/// <summary>
/// 根据资源路径获取其所在的 assetbundle 的名称
/// </summary>
/// <param name="path">资源路径</param>
/// <returns>返回 assetbundle 的名称</returns>
public static string GetAssetbundleNameByAssetPath(string path)

Meow.AssetUpdater.Core.UpdateOperation

/// <summary>
/// 当前正在下载的单个文件的进度 (0,1)
/// </summary>
public float SingleProgress{ get; }

/// <summary>
/// 总下载进度 (0,1)
/// </summary>
public float TotalProgress { get; }

/// <summary>
/// 当前正在下载的单个文件的已下载部分的大小
/// </summary>
public int SingleDownloadedSize { get; }

/// <summary>
/// 当前正在下载的单个文件的原始大小
/// </summary>
public int SingleSize { get; }

/// <summary>
/// 已下载的所有文件的大小
/// </summary>
public long TotalownloadedSize { get; }

/// <summary>
/// 所有欲下载的文件的总大小
/// </summary>
public long TotalSize { get; }

/// <summary>
/// 剩余文件的数量
/// </summary>
public int RemainBundleCount { get; }

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].