public void AddEffect( TextureEffect effect )
{
effect.controller = null;
// these effects must be unique, so remove any existing
if ( effect.type == TextureEffectType.EnvironmentMap ||
effect.type == TextureEffectType.UVScroll ||
effect.type == TextureEffectType.UScroll ||
effect.type == TextureEffectType.VScroll ||
effect.type == TextureEffectType.Rotate ||
effect.type == TextureEffectType.ProjectiveTexture )
{
for ( int i = 0; i < effectList.Count; i++ )
{
if ( ( (TextureEffect)effectList[ i ] ).type == effect.type )
{
effectList.RemoveAt( i );
break;
}
} // for
}
// create controller
if ( IsLoaded )
{
CreateEffectController( effect );
}
// add to internal list
effectList.Add( effect );
}