Files
test/Assets/PerfectWorld/Scripts/Vfx/CECGFXCaster.cs
T
2025-11-10 18:24:09 +07:00

73 lines
2.1 KiB
C#

using BrewMonster.PerfectWorld.Scripts.Vfx;
using BrewMonster.Scripts;
using UnityEngine;
namespace BrewMonster
{
public class CECGFXCaster
{
// Load normal gfx
public BaseVfxObject LoadGFXEx(string szFile)
{
if (string.IsNullOrEmpty(szFile))
{
BMLogger.LogError("path null!:");
return null;
}
// // ASSERT(m_pGFXMan);
// var loadObj = AddressableManager.Instance.LoadPrefabAsync(szFile.ToLower()).Result;
// if (loadObj == null)
// {
// BMLogger.LogError("Null vfx object in path: " + szFile);
// return null;
// }
// todo: make pool
BaseVfxObject pGFX = GameController.Instance.InstantiateObject(GameController.Instance.SelectingVfxPrefab).GetComponent<BaseVfxObject>();
if (!pGFX)
{
return null;
}
// NORMALGFX* pNode = new NORMALGFX;
// pNode->pGFX = pGFX;
// pNode->dwVisTimeCnt = TIME_CHECKVIS;
// pNode->bVisible = true;
//
// // Add to table
// m_GFXTab.put((int)pGFX, pNode);
return pGFX;
}
// // Release normal gfx
// void CECGFXCaster::ReleaseGFXEx(A3DGFXEx* pGFX, bool bCacheRelease/* true */)
// {
// if (!pGFX)
// return;
//
// // GFX exists ?
// GFXTable::pair_type Pair = m_GFXTab.get((int)pGFX);
// if (!Pair.second)
// return; // Counldn't find this GFX
//
// NORMALGFX* pNode = *Pair.first;
// m_GFXTab.erase((int)pGFX);
//
// if (bCacheRelease)
// {
// ASSERT(m_pGFXMan);
// m_pGFXMan->CacheReleasedGfx(pGFX);
// }
// else
// {
// pNode->pGFX->Release();
// delete pNode->pGFX;
// }
//
// delete pNode;
// }
}
}