update operation system

pull/151/head
hevinci 2023-08-25 17:37:49 +08:00
parent 6d37bca2a9
commit a2e57c6e90
2 changed files with 4 additions and 4 deletions

View File

@ -74,14 +74,14 @@ namespace YooAsset
internal abstract void Start();
internal abstract void Update();
internal void OnFinish()
internal void SetFinish()
{
Progress = 1f;
_callback?.Invoke(this);
if (_taskCompletionSource != null)
_taskCompletionSource.TrySetResult(null);
}
internal void OnStart()
internal void SetStart()
{
Status = EOperationStatus.Processing;
}

View File

@ -67,7 +67,7 @@ namespace YooAsset
if (operation.IsDone)
{
_removeList.Add(operation);
operation.OnFinish();
operation.SetFinish();
}
}
@ -101,7 +101,7 @@ namespace YooAsset
public static void StartOperation(AsyncOperationBase operation)
{
_addList.Add(operation);
operation.OnStart();
operation.SetStart();
operation.Start();
}
}