mirror of https://github.com/tuyoogame/YooAsset
Update document
parent
2bf36ebd8b
commit
578cd7ebb5
|
@ -37,6 +37,8 @@
|
|||
编写继承IAssetEncrypter接口的加密类。注意:加密类文件需要放置在Editor文件夹里。
|
||||
|
||||
````C#
|
||||
using YooAsset.Editor;
|
||||
|
||||
public class AssetEncrypter : IAssetEncrypter
|
||||
{
|
||||
/// <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#
|
||||
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);
|
||||
}
|
||||
````
|
||||
|
||||
|
|
Loading…
Reference in New Issue