mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-29 20:48:47 +00:00
update space shooter
This commit is contained in:
@@ -75,9 +75,19 @@ namespace UniFramework.Pooling
|
|||||||
for (int i = 0; i < _initCapacity; i++)
|
for (int i = 0; i < _initCapacity; i++)
|
||||||
{
|
{
|
||||||
var operation = AssetHandle.InstantiateAsync(_root.transform);
|
var operation = AssetHandle.InstantiateAsync(_root.transform);
|
||||||
|
operation.Completed += Operation_Completed;
|
||||||
_cacheOperations.Enqueue(operation);
|
_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>
|
/// <summary>
|
||||||
/// 销毁游戏对象池
|
/// 销毁游戏对象池
|
||||||
|
|||||||
Reference in New Issue
Block a user