PrecacheParticleSystem

From Valve Developer Community
Revision as of 09:57, 14 April 2011 by LordNed (talk | contribs) (Added todo about clarification)
Jump to: navigation, search

PrecacheMaterial is a function provided to Precache particle effects by string. It is generally used to precache specific particle systems rather than every system in a particle file.

To do: Clarify if this is the .pcf name or the particle name inside the .pcf!

Usage

//-----------------------------------------------------------------------------
// Precaches a particle system
//-----------------------------------------------------------------------------
void PrecacheParticleSystem( const char *pParticleSystemName )
{
	g_pStringTableParticleEffectNames->AddString( false, pParticleSystemName );
	g_pParticleSystemMgr->PrecacheParticleSystem( pParticleSystemName );
}


Examples

void CWeaponSMG1::Precache( void )
{
	PrecacheParticleSystem( "muzzle_smg1" );
}