Axiom.Graphics.TextureUnitState.ApplyTextureAliases C# (CSharp) Méthode

ApplyTextureAliases() public méthode

Applies texture names to Texture Unit State with matching texture name aliases. If no matching aliases are found then the TUS state does not change.
Cubic, 1d, 2d, and 3d textures are determined from current state of the Texture Unit. Assumes animated frames are sequentially numbered in the name. If matching texture aliases are found then true is returned.
public ApplyTextureAliases ( string>.Dictionary aliasList, bool apply ) : bool
aliasList string>.Dictionary is a map container of texture alias, texture name pairs
apply bool set true to apply the texture aliases else just test to see if texture alias matches are found.
Résultat bool
		public bool ApplyTextureAliases( Dictionary<string, string> aliasList, bool apply )
		{
			bool testResult = false;
			// if TUS has an alias, see if it's in the alias container
            if ( !string.IsNullOrEmpty( textureNameAlias ) )
			{
				if ( aliasList.ContainsKey( textureNameAlias ) )
				{
					// match was found so change the texture name in frames
					testResult = true;

					if ( apply )
					{
						// currently assumes animated frames are sequentially numbered
						// cubic, 1d, 2d, and 3d textures are determined from current TUS state

						if ( this.isCubic )
						{
							SetCubicTextureName( aliasList[ textureNameAlias ], textureType == TextureType.CubeMap );
						}
						else
						{
							// if more than one frame, then assume animated frames
							if ( numFrames > 1 )
							{
								SetAnimatedTextureName( aliasList[ textureNameAlias ], numFrames, animDuration );
							}
							else
							{
								SetTextureName( aliasList[ textureNameAlias ], textureType, textureSrcMipmaps );
							}
						}
					}
				}
			}
			return testResult;
		}