Unity5-CacheServer(资源平台切换之缓存服务器)的部署与使用
不管你是个人还是团队,如果你的资源很多, 而且经常切换平台, 那你试试这个吧~~秒秒钟实现平台间的转换。
cache server主要用于资源修改后的自动重新导入功能,保证所见即所得,方便资源的重新获取与导入,尤其在PC与手机端来回切换的时候,对机器要求:内存够大,快速硬盘和网络。测试过程:
1下载地址:http://unity3d.com/unity/collaboration/ ,然后安装http://game.ceeger.com/Manual/AssetCacheServer.html 上面的描述进行就好了
2 运行脚本 ,会在本地建立一个cache文件夹,作为数据存储位置
----------------------------------------------------------------------------------------------------
一、
当Unity工程中的一些资源文件被修改后,Unity探测到这些修改就会重新导入这些资源文件,并随后将产生的导入数据以自己的内部格式存放起来。而我们知道导入这些资源文件是很耗时间的,并且不同的平台导入数据也是不同的。
由此CacheServer就是要将这些产生的导入数据存储起来,当需要的时候直接从CacheServer取出来,而无需Unity本地再次生成导入数据。例如自己导入资源文件时会产生导入数据,自动上传到CacheServer,项目团队中其他成员导入资源文件后Unity不会产生导入数据,而会从CacheServer直接下载这些已经生成好的导入数据,从而大大缩短了大型团队导入资源的时间。使用Cache Server,不同平台之间的切换需要的时间显著减少,从而提高了制作速度。
二、部署CacheServer
自己用可以部署到自己的主机上,团队用可以考虑找一台主机去部署。CacheServer默认存储最大50GB,主机最好硬盘快
http://blog.csdn.net/wuming22222/article/details/51713758
http://docs.unity3d.com/Manual/CacheServer.html
-----------------------------------------------------------------------------------------------------------------
博主注:开启一个cache server可供好多项目使用,只要unity版本一致就行(cache server随unity一同发布)
第一个需要转换和上传,省不了时间,第二次或第二个人就好了,只用下载,切换1-3分钟左右
-----------------------------------------------------------------------------------------------------------------
CacheServer(缓存服务器)的性能很差,甚至会假死
- CacheServer(缓存服务器)的性能很差,甚至会假死。
Installing the Cache Server as a service
The provided .sh
and .cmd
scripts must be set up as a service on the server. The Cache Server can be safely killed and restarted at any time, since it uses atomic file operations.
New and legacy Cache Servers
Two Cache Server processes are started by default. The legacy Cache Server works with versions of Unity prior to version 5.0. The new Cache Server works with versions of Unity from 5.0 and up. See Cache Server configuration, below for details on configuring, enabling, and disabling the two different Cache Servers.
Cache Server configuration
If you simply start by executing the script, it launches the legacy Cache Server on port 8125 and the new Cache Server on port 8126. It also creates “cache” and “cache5.0” directories in the same directory as the script, and keep data in there. The cache directories are allowed to grow to up to 50 GB by default. You can configure the size and the location of the data using command line options, like this:
./RunOSX.command --path ~/mycachePath --size 2000000000
or
./RunOSX.command --path ~/mycachePath --port 8199 --nolegacy
You can configure the Cache Server by using the following command line options:
- Use
--port
to specify the server port. This only applies to the new Cache Server. The default value is8126
. - Use
--path
to specify the path of the cache location. This only applies to the new Cache Server. The default value is./cache5.0
. - Use
--legacypath
to specify the path of the cache location. This only applies to the legacy Cache Server. The default value is./cache
. - Use
--size
to specify the maximum cache size in bytes for both Cache Servers. Files that have not been used recently are automatically discarded when the cache size is exceeded. - Use
--nolegacy
to stop the legacy Cache Server starting. Otherwise, the legacy Cache Server is started on port8125
.