diff --git a/Docs/AssetBuilder.md b/Docs/AssetBuilder.md index 7d41c71..af567dd 100644 --- a/Docs/AssetBuilder.md +++ b/Docs/AssetBuilder.md @@ -37,6 +37,8 @@ 编写继承IAssetEncrypter接口的加密类。注意:加密类文件需要放置在Editor文件夹里。 ````C# +using YooAsset.Editor; + public class AssetEncrypter : IAssetEncrypter { /// diff --git a/Docs/CodeTutorial1.md b/Docs/CodeTutorial1.md index 8ec7569..0ed493e 100644 --- a/Docs/CodeTutorial1.md +++ b/Docs/CodeTutorial1.md @@ -64,3 +64,15 @@ private IEnumerator InitializeYooAsset() } ```` +**资源文件解密** + +````c# +public class BundleDecryption : IDecryptionServices +{ + public ulong GetFileOffset(BundleInfo bundleInfo) + { + return 32; + } +} +```` + diff --git a/Docs/CodeTutorial3.md b/Docs/CodeTutorial3.md index 154fcaf..ffc7308 100644 --- a/Docs/CodeTutorial3.md +++ b/Docs/CodeTutorial3.md @@ -103,18 +103,15 @@ foreach (var asset in handle.AllAssets) ````c# void Start() { - // 场景加载参数 - SceneInstanceParam param = new SceneInstanceParam(); - param.LoadMode = UnityEngine.SceneManagement.LoadSceneMode.Single; - param.ActivateOnLoad = true; + var sceneMode = UnityEngine.SceneManagement.LoadSceneMode.Single; + bool activateOnLoad = true; - AssetOperationHandle handle = YooAssets.LoadSceneAsync("Scene/Login", param); + SceneOperationHandle handle = YooAssets.LoadSceneAsync("Scene/Login", sceneMode, activateOnLoad); handle.Completed += Handle_Completed; } -void Handle_Completed(AssetOperationHandle handle) +void Handle_Completed(SceneOperationHandle handle) { - SceneInstance instance = handle.AssetInstance as SceneInstance; - Debug.Log(instance.Scene.name); + Debug.Log(handle.Scene.name); } ````