private void UpdateCurveInformation(string nameOfClip, CurveInformation curveInformationToUpdate, AnimationClipCurveData animationCruveData) { List <string> curveInformationNames = animationCruveData.path.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries).ToList(); curveInformationNames.Insert(0, nameOfClip); curveInformationNames.Add(animationCruveData.type.ToString()); curveInformationNames.Add(animationCruveData.propertyName); curveInformationToUpdate.AddIfNonExistant(curveInformationNames, animationCruveData); }
public CurveInformation AddIfNonExistant(List <string> path, AnimationClipCurveData animationCLipCurveData) { if (Name.Equals(path[0])) { if (path.Count == 1) { AnimationClipCurveData = animationCLipCurveData; return(this); } var pathReduced = path; pathReduced.RemoveAt(0); foreach (CurveInformation curveInformation in Children) { if (curveInformation.Name.Equals(pathReduced[0])) { CurveInformation childResult = curveInformation.AddIfNonExistant(pathReduced, animationCLipCurveData); if (childResult != null) { return(childResult); } } } } CurveInformation newChild = new CurveInformation(path[0]); Children.Add(newChild); if (path.Count == 1) { newChild.AnimationClipCurveData = animationCLipCurveData; return(newChild); } else { var pathReduced = path; pathReduced.RemoveAt(0); return(newChild.AddIfNonExistant(pathReduced, animationCLipCurveData)); } }
public CurveInformation AddIfNonExistant(List<string> path, AnimationClipCurveData animationCLipCurveData) { if (Name.Equals(path[0])) { if (path.Count == 1) { AnimationClipCurveData = animationCLipCurveData; return this; } var pathReduced = path; pathReduced.RemoveAt(0); foreach (CurveInformation curveInformation in Children) { if (curveInformation.Name.Equals(pathReduced[0])) { CurveInformation childResult = curveInformation.AddIfNonExistant(pathReduced, animationCLipCurveData); if (childResult != null) { return childResult; } } } } CurveInformation newChild = new CurveInformation(path[0]); Children.Add(newChild); if (path.Count == 1) { newChild.AnimationClipCurveData = animationCLipCurveData; return newChild; } else { var pathReduced = path; pathReduced.RemoveAt(0); return newChild.AddIfNonExistant(pathReduced, animationCLipCurveData); } }
private void UpdateCurveInformation(string nameOfClip, CurveInformation curveInformationToUpdate, AnimationClipCurveData animationCruveData) { List<string> curveInformationNames = animationCruveData.path.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries).ToList(); curveInformationNames.Insert(0, nameOfClip); curveInformationNames.Add(animationCruveData.type.ToString()); curveInformationNames.Add(animationCruveData.propertyName); curveInformationToUpdate.AddIfNonExistant(curveInformationNames, animationCruveData); }