public AttachNodeBaseData(String nodeData) { String[] dataVals = nodeData.Split(new String[] { "," }, StringSplitOptions.None); position = new Vector3(ROTUtils.safeParseFloat(dataVals[0].Trim()), ROTUtils.safeParseFloat(dataVals[1].Trim()), ROTUtils.safeParseFloat(dataVals[2].Trim())); orientation = new Vector3(ROTUtils.safeParseFloat(dataVals[3].Trim()), ROTUtils.safeParseFloat(dataVals[4].Trim()), ROTUtils.safeParseFloat(dataVals[5].Trim())); size = dataVals.Length > 6 ? ROTUtils.safeParseInt(dataVals[6]) : 4; }
public static int[] GetIntValues(this ConfigNode node, string name, int[] defaultValues = null) { int[] values = defaultValues; string[] stringValues = node.GetValues(name); if (stringValues == null || stringValues.Length == 0) { return(values); } int len = stringValues.Length; values = new int[len]; for (int i = 0; i < len; i++) { values[i] = ROTUtils.safeParseInt(stringValues[i]); } return(values); }