/// <summary> /// Write the save file. /// </summary> public static void WriteSave() { if (Loaded == null) { Loaded = new EnhancedGUISave(); } foreach (var renderer in EnhancedGUIRenderer.Renderers) { foreach (var window in renderer.Windows) { var data = Loaded.GetWindowData(window.Name); if (data == null) { data = new SerializableWindow(); Loaded.Windows.Add(data); } data.Name = window.Name; data.Ready = true; data.X = window.Rect.x; data.Y = window.Rect.y; data.Height = window.Rect.height; data.Width = window.Rect.width; data.IsContentActive = window.IsContentActive; } } File.WriteAllText(SaveFileName, JsonUtility.ToJson(Loaded, true)); }