mirror of https://github.com/tuyoogame/YooAsset
Update document
parent
09a985fadb
commit
023dc82f8e
|
@ -14,5 +14,9 @@ CDN
|
||||||
├─v1.0
|
├─v1.0
|
||||||
├─v1.1
|
├─v1.1
|
||||||
└─v2.0
|
└─v2.0
|
||||||
|
└─iphone
|
||||||
|
├─v1.0
|
||||||
|
├─v1.1
|
||||||
|
└─v2.0
|
||||||
````
|
````
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ YooAssets.InitializeAsync(CreateParameters parameters);
|
||||||
private IEnumerator InitializeYooAsset()
|
private IEnumerator InitializeYooAsset()
|
||||||
{
|
{
|
||||||
var createParameters = new YooAssets.EditorPlayModeParameters();
|
var createParameters = new YooAssets.EditorPlayModeParameters();
|
||||||
createParameters.LocationRoot = "Assets/GameRes";
|
createParameters.LocationServices = new DefaultLocationServices("Assets/GameRes");
|
||||||
yield return YooAssets.InitializeAsync(createParameters);
|
yield return YooAssets.InitializeAsync(createParameters);
|
||||||
}
|
}
|
||||||
````
|
````
|
||||||
|
@ -32,7 +32,7 @@ private IEnumerator InitializeYooAsset()
|
||||||
private IEnumerator InitializeYooAsset()
|
private IEnumerator InitializeYooAsset()
|
||||||
{
|
{
|
||||||
var createParameters = new YooAssets.OfflinePlayModeParameters();
|
var createParameters = new YooAssets.OfflinePlayModeParameters();
|
||||||
createParameters.LocationRoot = "Assets/GameRes";
|
createParameters.LocationServices = new DefaultLocationServices("Assets/GameRes");
|
||||||
yield return YooAssets.InitializeAsync(createParameters);
|
yield return YooAssets.InitializeAsync(createParameters);
|
||||||
}
|
}
|
||||||
````
|
````
|
||||||
|
@ -43,7 +43,10 @@ private IEnumerator InitializeYooAsset()
|
||||||
|
|
||||||
注意:该模式需要构建资源包
|
注意:该模式需要构建资源包
|
||||||
|
|
||||||
- LocationRoot : 资源定位的根路径,所有通过代码加载的资源文件都需要放在资源定位的根路径下。
|
- LocationServices : 资源定位的实例类。
|
||||||
|
1. 默认的资源定位服务类(DefaultLocationServices)
|
||||||
|
2. 可寻址的资源定位服务类(AdressLocationServices)
|
||||||
|
3. 开发者自定义的资源定位服务类,需要提供实现ILocationServices接口的实例类。
|
||||||
- DecryptionServices : 如果资源包在构建的时候有加密,需要提供实现IDecryptionServices接口的实例类。
|
- DecryptionServices : 如果资源包在构建的时候有加密,需要提供实现IDecryptionServices接口的实例类。
|
||||||
- ClearCacheWhenDirty : 安装包在覆盖安装的时候,是否清空沙盒缓存文件夹。
|
- ClearCacheWhenDirty : 安装包在覆盖安装的时候,是否清空沙盒缓存文件夹。
|
||||||
- DefaultHostServer : 默认的资源服务器IP地址。
|
- DefaultHostServer : 默认的资源服务器IP地址。
|
||||||
|
@ -53,7 +56,7 @@ private IEnumerator InitializeYooAsset()
|
||||||
private IEnumerator InitializeYooAsset()
|
private IEnumerator InitializeYooAsset()
|
||||||
{
|
{
|
||||||
var createParameters = new YooAssets.HostPlayModeParameters();
|
var createParameters = new YooAssets.HostPlayModeParameters();
|
||||||
createParameters.LocationRoot = "Assets/GameRes";
|
createParameters.LocationServices = new DefaultLocationServices("Assets/GameRes");
|
||||||
createParameters.DecryptionServices = null;
|
createParameters.DecryptionServices = null;
|
||||||
createParameters.ClearCacheWhenDirty = false;
|
createParameters.ClearCacheWhenDirty = false;
|
||||||
createParameters.DefaultHostServer = "http://127.0.0.1/CDN1/Android";
|
createParameters.DefaultHostServer = "http://127.0.0.1/CDN1/Android";
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
# 资源加载
|
# 资源加载
|
||||||
|
|
||||||
在加载资源对象的时候只需要提供相对路径,统一约定该相对路径名称为:location
|
|
||||||
|
|
||||||
加载接口:
|
加载接口:
|
||||||
|
|
||||||
- YooAssets.LoadAssetSync() 同步加载资源对象接口
|
- YooAssets.LoadAssetSync() 同步加载资源对象接口
|
||||||
|
@ -11,6 +9,8 @@
|
||||||
- YooAssets.LoadSceneAsync() 异步加载场景接口
|
- YooAssets.LoadSceneAsync() 异步加载场景接口
|
||||||
- YooAssets.LoadRawFileAsync() 异步读取原生文件接口
|
- YooAssets.LoadRawFileAsync() 异步读取原生文件接口
|
||||||
|
|
||||||
|
统一约定:location为资源的定位地址,也是加载资源对象的唯一标识符。
|
||||||
|
|
||||||
**加载路径的匹配方式**
|
**加载路径的匹配方式**
|
||||||
|
|
||||||
````C#
|
````C#
|
||||||
|
|
Loading…
Reference in New Issue