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. You can then call this method by passing a reference to a StringToken
that identifies the attribute you want to retrieve, along with a reference to a Vector4
that represents the default value to return if the attribute is not found.
RenderAttributes renderAttributes = new RenderAttributes(); StringToken attributeName = new StringToken("MyVector4Attribute"); Vector4 defaultValue = new Vector4(1.0f, 1.0f, 1.0f, 1.0f); Vector4 result = renderAttributes.GetVector4(ref attributeName, ref defaultValue); // Use the result Vector4 as needed // For example, apply it to a shader or use it in calculations