Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string Vector3String(Vector3 vector)
- {
- /* An output string might look like */
- /* 150,250,0 */
- return (string.Format("{0},{1},{2}", vector.x, vector.y, vector.z));
- }
- public Vector3 StringToVector3(string vector)
- {
- /* Split the string into a series of string, seperated by the comma */
- string[] components = vector.Split(',');
- /* Parse the strings into ints and insert those as the Vectors X/Y and Z */
- return new Vector3(int.Parse(component[0]), int.Parse(component[1]), int.Parse(component[2]));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement