PrecacheMaterial

From Valve Developer Community
Revision as of 23:00, 9 April 2011 by LordNed (talk | contribs) (Created page with 'PrecacheMaterial is a function provided to Precache materials by string. It is generally used to Precache assets used by an entity. == Usage == <source lang=cpp> //------------…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

PrecacheMaterial is a function provided to Precache materials by string. It is generally used to Precache assets used by an entity.


Usage

//-----------------------------------------------------------------------------
// Purpose: Add material to precache
// Input  : *pMaterialName - material name
// Output : 
//-----------------------------------------------------------------------------
void PrecacheMaterial( const char *pMaterialName )


Examples

void CFireTrail::Precache( void )
{
	PrecacheMaterial( "sprites/flamelet1" );
	PrecacheMaterial( "sprites/flamelet2" );
	PrecacheMaterial( "particle/particle_smokegrenade" );
	PrecacheMaterial( "particle/particle_noisesphere" );
}
void CCitadelEnergyCore::Precache()
{
	BaseClass::Precache();
	PrecacheMaterial( "effects/combinemuzzle2_dark" ); 
}