地图系统
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using BaseGames.Core.Assets;
|
||||
|
||||
namespace BaseGames.VFX
|
||||
{
|
||||
@@ -73,7 +74,7 @@ namespace BaseGames.VFX
|
||||
Quaternion rotation,
|
||||
float maxLifetime)
|
||||
{
|
||||
var op = Addressables.InstantiateAsync(vfxRef, transform);
|
||||
var op = AssetLoader.InstantiateAsync(vfxRef, transform);
|
||||
yield return op;
|
||||
if (op.Result == null)
|
||||
{
|
||||
@@ -84,7 +85,7 @@ namespace BaseGames.VFX
|
||||
if (ps == null)
|
||||
{
|
||||
Debug.LogError($"[VFXPool] No ParticleSystem on VFX prefab: {vfxRef.RuntimeKey}");
|
||||
Addressables.ReleaseInstance(op.Result);
|
||||
AssetLoader.ReleaseInstance(op.Result);
|
||||
yield break;
|
||||
}
|
||||
ps.gameObject.SetActive(false);
|
||||
@@ -126,11 +127,11 @@ namespace BaseGames.VFX
|
||||
{
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var op = Addressables.InstantiateAsync(vfxRef, transform);
|
||||
var op = AssetLoader.InstantiateAsync(vfxRef, transform);
|
||||
yield return op;
|
||||
if (op.Result == null) continue;
|
||||
var ps = op.Result.GetComponent<ParticleSystem>();
|
||||
if (ps == null) { Addressables.ReleaseInstance(op.Result); continue; }
|
||||
if (ps == null) { AssetLoader.ReleaseInstance(op.Result); continue; }
|
||||
ps.gameObject.SetActive(false);
|
||||
Enqueue(vfxRef, ps);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user