12345678910111213141516171819202122232425 |
- using System.Collections.Generic;
- using UnityEngine;
- public static class DataParse
- {
- public static Color StringToColor(this string str)
- {
- string[] strings = str.Split(' ');
- return new Color(float.Parse(strings[0]), float.Parse(strings[1]), float.Parse(strings[2]), float.Parse(strings[3]));
- }
- public static Vector3[] StringToTransform(this string str)
- {
- string[] strings = str.Split(' ');
- Vector3[] vectors = new[]
- {
- new Vector3(float.Parse(strings[0]), float.Parse(strings[1]), float.Parse(strings[2])),
- new Vector3(float.Parse(strings[3]), float.Parse(strings[4]), float.Parse(strings[5])),
- };
- return vectors;
- }
- }
|