mirror of https://github.com/tuyoogame/YooAsset
update space shooter
parent
93b58149d2
commit
fcf9eff2f6
|
@ -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>
|
||||
/// 销毁游戏对象池
|
||||
|
|
Loading…
Reference in New Issue