ToolScript.cs 432 B

1234567891011121314151617181920
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class ToolScript
  5. {
  6. // Start is called before the first frame update
  7. public Vector3 StrSubstringToV3(string str)
  8. {
  9. if (str == null)
  10. {
  11. return new Vector3();
  12. }
  13. string[] s = str.Split('_');
  14. return new Vector3(float.Parse(s[0]), float.Parse(s[1]), float.Parse(s[2]));
  15. }
  16. }