mirror of https://github.com/tuyoogame/YooAsset
Update document
parent
2bf36ebd8b
commit
578cd7ebb5
|
@ -37,6 +37,8 @@
|
||||||
编写继承IAssetEncrypter接口的加密类。注意:加密类文件需要放置在Editor文件夹里。
|
编写继承IAssetEncrypter接口的加密类。注意:加密类文件需要放置在Editor文件夹里。
|
||||||
|
|
||||||
````C#
|
````C#
|
||||||
|
using YooAsset.Editor;
|
||||||
|
|
||||||
public class AssetEncrypter : IAssetEncrypter
|
public class AssetEncrypter : IAssetEncrypter
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -64,3 +64,15 @@ private IEnumerator InitializeYooAsset()
|
||||||
}
|
}
|
||||||
````
|
````
|
||||||
|
|
||||||
|
**资源文件解密**
|
||||||
|
|
||||||
|
````c#
|
||||||
|
public class BundleDecryption : IDecryptionServices
|
||||||
|
{
|
||||||
|
public ulong GetFileOffset(BundleInfo bundleInfo)
|
||||||
|
{
|
||||||
|
return 32;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
````
|
||||||
|
|
||||||
|
|
|
@ -103,18 +103,15 @@ foreach (var asset in handle.AllAssets)
|
||||||
````c#
|
````c#
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
// 场景加载参数
|
var sceneMode = UnityEngine.SceneManagement.LoadSceneMode.Single;
|
||||||
SceneInstanceParam param = new SceneInstanceParam();
|
bool activateOnLoad = true;
|
||||||
param.LoadMode = UnityEngine.SceneManagement.LoadSceneMode.Single;
|
|
||||||
param.ActivateOnLoad = true;
|
|
||||||
|
|
||||||
AssetOperationHandle handle = YooAssets.LoadSceneAsync("Scene/Login", param);
|
SceneOperationHandle handle = YooAssets.LoadSceneAsync("Scene/Login", sceneMode, activateOnLoad);
|
||||||
handle.Completed += Handle_Completed;
|
handle.Completed += Handle_Completed;
|
||||||
}
|
}
|
||||||
void Handle_Completed(AssetOperationHandle handle)
|
void Handle_Completed(SceneOperationHandle handle)
|
||||||
{
|
{
|
||||||
SceneInstance instance = handle.AssetInstance as SceneInstance;
|
Debug.Log(handle.Scene.name);
|
||||||
Debug.Log(instance.Scene.name);
|
|
||||||
}
|
}
|
||||||
````
|
````
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue