Update document

pull/4/head
hevinci 2022-03-21 23:49:50 +08:00
parent 2bf36ebd8b
commit 578cd7ebb5
3 changed files with 19 additions and 8 deletions

View File

@ -37,6 +37,8 @@
编写继承IAssetEncrypter接口的加密类。注意加密类文件需要放置在Editor文件夹里。 编写继承IAssetEncrypter接口的加密类。注意加密类文件需要放置在Editor文件夹里。
````C# ````C#
using YooAsset.Editor;
public class AssetEncrypter : IAssetEncrypter public class AssetEncrypter : IAssetEncrypter
{ {
/// <summary> /// <summary>

View File

@ -64,3 +64,15 @@ private IEnumerator InitializeYooAsset()
} }
```` ````
**资源文件解密**
````c#
public class BundleDecryption : IDecryptionServices
{
public ulong GetFileOffset(BundleInfo bundleInfo)
{
return 32;
}
}
````

View File

@ -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);
} }
```` ````