Init
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UniFramework.Machine;
|
||||
using YooAsset;
|
||||
|
||||
internal class FsmClearCacheBundle : IStateNode
|
||||
{
|
||||
private StateMachine _machine;
|
||||
PatchOperationData data;
|
||||
void IStateNode.OnCreate(StateMachine machine)
|
||||
{
|
||||
_machine = machine;
|
||||
}
|
||||
void IStateNode.OnEnter()
|
||||
{
|
||||
data = (PatchOperationData)_machine.GetBlackboardValue("PatchOperationData");
|
||||
var packageName = data.packageName;
|
||||
var package = YooAssets.GetPackage(packageName);
|
||||
var operation = package.ClearCacheFilesAsync(EFileClearMode.ClearUnusedBundleFiles);
|
||||
operation.Completed += Operation_Completed;
|
||||
}
|
||||
void IStateNode.OnUpdate()
|
||||
{
|
||||
}
|
||||
void IStateNode.OnExit()
|
||||
{
|
||||
}
|
||||
|
||||
private void Operation_Completed(YooAsset.AsyncOperationBase obj)
|
||||
{
|
||||
_machine.ChangeState<FsmStartGame>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user