// Particle test for Maxman
class ParticleTest extends ItemBase
{
protected int PARTICLE_PATH;
protected Particle m_Particle;
// Constructor
void ParticleTest()
{
if ( !g_Game.IsServer() || !g_Game.IsMultiplayer() ) // Client side
{
string path = ParticleList.GetPathToParticles();
// Enter particle ID to play when ParticleTest spawns
PARTICLE_PATH = ParticleList.DEBUG_DOT;
// Alternatively, uncomment the second line and enter particle filename without *.ptc suffix instead. Example: "menu_engine_fire"
string particle_filename = "menu_engine_fire";
//PARTICLE_PATH = ParticleList.GetParticleID( path + particle_filename );
m_Particle = ParticleManager.GetInstance().PlayOnObject( PARTICLE_PATH, this, GetPosition());
}
}
// Destructor
override void EEDelete(EntityAI parent)
{
super.EEDelete(parent);
if (m_Particle && g_Game) // g_Game is null when the game is being shut down
{
m_Particle.Stop();
g_Game.ObjectDelete(m_Particle);
}
}
}
Esc
↑↓ to navigate · ↵ to open · type Class.member to scope