/// <summary>
/// Inserts a new TextureUnitState object into the Pass.
/// </summary>
/// <remarks>
/// This unit is is added on top of all previous texture units.
/// <p/>
/// Applies to both fixed-function and programmable passes.
/// </remarks>
/// <param name="textureName">The basic name of the texture (i.e. brickwall.jpg)</param>
/// <param name="texCoordSet">The index of the texture coordinate set to use.</param>
/// <returns></returns>
public TextureUnitState CreateTextureUnitState( string textureName, int texCoordSet )
{
TextureUnitState state = new TextureUnitState( this );
state.SetTextureName( textureName );
state.TextureCoordSet = texCoordSet;
textureUnitStates.Add( state );
// needs recompilation
_parent.NotifyNeedsRecompile();
DirtyHash();
return state;
}