Description
The Vector3.Parse
method is a static method that converts a string representation of a 3D vector into a Vector3
object. This method is particularly useful when you need to interpret vector data from a textual format, such as user input or data files.
Usage
To use the Vector3.Parse
method, provide a string that represents a vector in the format "x, y, z" where x, y, and z are floating-point numbers. Optionally, you can also provide an IFormatProvider
to specify culture-specific formatting information.
Example
// Example of parsing a vector from a string
string vectorString = "1.0, 2.0, 3.0";
Vector3 vector = Vector3.Parse(vectorString, CultureInfo.InvariantCulture);
// The resulting vector will have x = 1.0, y = 2.0, z = 3.0