The GetVector4
method retrieves a Vector4
value associated with a specified StringToken
from the RenderAttributes
collection. If the specified attribute does not exist, the method returns a default value provided by the caller.
The GetVector4
method retrieves a Vector4
value associated with a specified StringToken
from the RenderAttributes
collection. If the specified attribute does not exist, the method returns a default value provided by the caller.
To use the GetVector4
method, you need to have an instance of the RenderAttributes
class. Call the method with a StringToken
that identifies the attribute you want to retrieve and a Vector4
that serves as the default value if the attribute is not found.
Parameters:
name
: A reference to a StringToken
that identifies the attribute.defaultValue
: A reference to a Vector4
that provides the default value if the attribute is not found.Returns: A Vector4
value associated with the specified StringToken
, or the provided default value if the attribute is not found.
RenderAttributes renderAttributes = new RenderAttributes(); StringToken attributeName = new StringToken("MyVector4Attribute"); Vector4 defaultVector = new Vector4(1.0f, 1.0f, 1.0f, 1.0f); Vector4 result = renderAttributes.GetVector4(ref attributeName, ref defaultVector); // Use 'result' as needed