示例#1
0
        /// <summary>
        /// Parses a Quaterion
        /// </summary>
        /// <param name="v"></param>
        /// <param name="a"></param>
        /// <param name="axis"></param>
        /// <param name="bUseRadians"></param>
        /// <returns></returns>
        public static Quaternion ToQuaternion(string sval)
        {
            if (string.IsNullOrEmpty(sval))
            {
                return(Quaternion.identity);
            }

            var arr = StringUtil.SplitFixedLength(sval.Replace(" ", ""), ',', 4);

            return(new Quaternion(ConvertUtil.ToSingle(arr[0]), ConvertUtil.ToSingle(arr[1]), ConvertUtil.ToSingle(arr[2]), ConvertUtil.ToSingle(arr[3])));
        }
示例#2
0
        public static Vector4 ToVector4(string sval)
        {
            if (System.String.IsNullOrEmpty(sval))
            {
                return(Vector3.zero);
            }

            var arr = StringUtil.SplitFixedLength(sval, ',', 4);

            return(new Vector4(ConvertUtil.ToSingle(arr[0]), ConvertUtil.ToSingle(arr[1]), ConvertUtil.ToSingle(arr[2]), ConvertUtil.ToSingle(arr[3])));
        }