public static Quaternion ReadQuaternion(Dictionary <string, object> inDict, string inQuatName, out bool outSuccess, Quaternion inDefaultValue = default(Quaternion)) { Quaternion returnVal = inDefaultValue; if (inDict.ContainsKey(inQuatName) == true) { outSuccess = false; List <float> floatList = JSONTools.ReadFloatList(inDict[inQuatName]); if (floatList != null) { if (floatList.Count == 4) { returnVal.x = floatList[0]; returnVal.y = floatList[1]; returnVal.z = floatList[2]; returnVal.w = floatList[3]; outSuccess = true; } } } else { outSuccess = false; } return(returnVal); }
public static Vector3 ReadVector3(Dictionary <string, object> inDict, string inVector3Name, out bool outSuccess, Vector3 inDefaultValue = default(Vector3)) { Vector3 returnVal = inDefaultValue; if (inDict.ContainsKey(inVector3Name) == true) { outSuccess = false; List <float> floatList = JSONTools.ReadFloatList(inDict[inVector3Name]); if (floatList != null) { if (floatList.Count == 3) { returnVal.x = floatList[0]; returnVal.y = floatList[1]; returnVal.z = floatList[2]; outSuccess = true; } } } else { outSuccess = false; } return(returnVal); }
public List <float> toFloatList() { return(JSONTools.ReadFloatList(obj)); }