mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-20 15:20:07 +00:00
update space shooter
This commit is contained in:
@@ -75,9 +75,19 @@ namespace UniFramework.Pooling
|
||||
for (int i = 0; i < _initCapacity; i++)
|
||||
{
|
||||
var operation = AssetHandle.InstantiateAsync(_root.transform);
|
||||
operation.Completed += Operation_Completed;
|
||||
_cacheOperations.Enqueue(operation);
|
||||
}
|
||||
}
|
||||
private void Operation_Completed(AsyncOperationBase obj)
|
||||
{
|
||||
if (obj.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
var op = obj as InstantiateOperation;
|
||||
if (op.Result != null)
|
||||
op.Result.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 销毁游戏对象池
|
||||
|
||||
Reference in New Issue
Block a user