private void LoadFromString() { if (rootList == null) { rootList = new List <VirtualFolderInfo>(); } rootList.Clear(); foreach (var listInfo in allInfos) { rootList.Add(VirtualFolderUtility.ListToTree(listInfo.infos)); } }
public string SaveToString() { if (allInfos == null) { allInfos = new List <VirtualFolderSubList>(); } allInfos.Clear(); foreach (var info in rootList) { List <VirtualFolderInfo> infoList = new List <VirtualFolderInfo>(); VirtualFolderUtility.UpdateDepthValues(info); VirtualFolderUtility.TreeToList(info, infoList); allInfos.Add(new VirtualFolderSubList(infoList)); } return(JsonUtility.ToJson(this)); }