Axiom.Serialization.MaterialSerializer.ParseCubicTexture C# (CSharp) Метод

ParseCubicTexture() приватный Метод

private ParseCubicTexture ( string parameters, MaterialScriptContext context ) : bool
parameters string
context MaterialScriptContext
Результат bool
		protected static bool ParseCubicTexture( string parameters, MaterialScriptContext context )
		{
			string[] values = parameters.Split( new char[] { ' ', '\t' } );

			bool useUVW;
			string uvw = values[ values.Length - 1 ].ToLower();

			switch ( uvw )
			{
				case "combineduvw":
					useUVW = true;
					break;
				case "separateuv":
					useUVW = false;
					break;
				default:
					LogParseError( context, "Bad cubic_texture attribute, last param must be 'combinedUVW' or 'separateUV'." );
					return false;
			}

			// use base name to infer the 6 texture names
			if ( values.Length == 2 )
			{
				context.textureUnit.SetCubicTextureName( values[ 0 ], useUVW );
			}
			else if ( values.Length == 7 )
			{
				// copy the array elements for the 6 tex names
				string[] names = new string[ 6 ];
				Array.Copy( values, 0, names, 0, 6 );

				context.textureUnit.SetCubicTextureName( names, useUVW );
			}
			else
			{
				LogParseError( context, "Bad cubic_texture attribute, wrong number of parameters (expected 2 or 7)." );
			}

			return false;
		}