The GetVector
method retrieves a Vector3
value associated with a specified StringToken
key from the RenderAttributes
collection. If the key does not exist, it returns a default value provided by the caller.
The GetVector
method retrieves a Vector3
value associated with a specified StringToken
key from the RenderAttributes
collection. If the key does not exist, it returns a default value provided by the caller.
To use the GetVector
method, you need to have an instance of RenderAttributes
. Call the method with a StringToken
representing the key and a Vector3
as the default value. The method will return the corresponding Vector3
value if the key exists, or the default value if it does not.
RenderAttributes renderAttributes = new RenderAttributes(); StringToken key = new StringToken("position"); Vector3 defaultPosition = new Vector3(0, 0, 0); Vector3 position = renderAttributes.GetVector(key, defaultPosition); // Use the 'position' variable as needed.