public string RenameAnimationGroup(AnimationGroup info, string name) { AnimationGroupList animationGroupList = new AnimationGroupList(); animationGroupList.LoadFromData(); AnimationGroup animGroupToRename = animationGroupList.GetAnimationGroupByName(info.Name); string baseName = name; int i = 0; bool hasConflict = true; while (hasConflict) { hasConflict = false; foreach (AnimationGroup animationGroup in animationGroupList) { if (baseName.Equals(animationGroup.Name)) { baseName = name + i.ToString(); ++i; hasConflict = true; break; } } } animGroupToRename.Name = baseName; // save info and animation list entry animationGroupList.SaveToData(); Loader.Global.SetSaveRequiredFlag(true, false); return(baseName); }