void LoadState() { LayoutDataCollection pd = null; pd = pd.FromJson(fileName); if (pd == null) { Debug.Log("not loaded"); } pd.BuildDictionary(); var layouts = GetLayouts(); foreach (var p in layouts) { var pp = pd.GetData(p.id); if (pp != null) { p.SetData(pp); } else { Debug.Log("could not find panel data " + p.id); } //pd.data.Add(p.GetData()); } }
void SaveState() { LayoutDataCollection pd = new LayoutDataCollection(); var layouts = GetLayouts(); foreach (var p in layouts) { pd.panelData.Add(p.GetData()); } pd.ToJson(fileName); Debug.Log("found " + layouts.Count + "p anels"); }