protected static bool ParseColorOpFallback( string parameters, MaterialScriptContext context )
{
string[] values = parameters.Split( new char[] { ' ', '\t' } );
// lookup the real enums equivalent to the script values
object srcVal = ScriptEnumAttribute.Lookup( values[ 0 ], typeof( SceneBlendFactor ) );
object destVal = ScriptEnumAttribute.Lookup( values[ 1 ], typeof( SceneBlendFactor ) );
// if both values were found, assign them
if ( srcVal != null && destVal != null )
{
context.textureUnit.SetColorOpMultipassFallback( (SceneBlendFactor)srcVal, (SceneBlendFactor)destVal );
}
else
{
string legalValues = ScriptEnumAttribute.GetLegalValues( typeof( SceneBlendFactor ) );
if ( srcVal == null )
{
LogParseError( context, "Bad color_op_multipass_fallback attribute, valid values for src value are {0}.", legalValues );
}
if ( destVal == null )
{
LogParseError( context, "Bad color_op_multipass_fallback attribute, valid values for dest value are {0}.", legalValues );
}
}
return false;
}