多轮审查和修复
This commit is contained in:
@@ -31,22 +31,11 @@ namespace BaseGames.VFX
|
||||
_map[e.type] = e.vfxRef;
|
||||
}
|
||||
|
||||
/// <summary>根据 HitFxType 查找对应 VFX Prefab 引用。</summary>
|
||||
/// <summary>根据 HitFxType 查找对应 VFX Prefab 引用。调用前必须先调用 Initialize()。</summary>
|
||||
public bool TryGetHitFX(HitFxType type, out AssetReferenceGameObject vfxRef)
|
||||
{
|
||||
if (_map != null)
|
||||
return _map.TryGetValue(type, out vfxRef);
|
||||
|
||||
// 未初始化时回退至线性查找
|
||||
if (hitEffects != null)
|
||||
{
|
||||
foreach (var e in hitEffects)
|
||||
{
|
||||
if (e.type == type) { vfxRef = e.vfxRef; return true; }
|
||||
}
|
||||
}
|
||||
vfxRef = default;
|
||||
return false;
|
||||
Debug.Assert(_map != null, "[VFXCatalogSO] TryGetHitFX 被调用前必须先调用 Initialize()。");
|
||||
return _map.TryGetValue(type, out vfxRef);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user