Unity Save Edit -
Unity Save Edit -
public static bool TryLoadWithRepair(out PlayerSaveData data)
#if UNITY_EDITOR using UnityEditor; [CustomEditor(typeof(SaveManager))] public class SaveManagerEditor : Editor unity save edit
saveData.unlockedItems = GetAllItemIDs(); SaveGame(saveData); return new PlayerSaveData()
return new PlayerSaveData(); // default values try data = LoadGame()
public override void OnInspectorGUI() DrawDefaultInspector(); if (GUILayout.Button("Edit Current Save")) SaveManager.EditSaveInJsonEditor();
try data = LoadGame(); Validate(data); return true; catch (Exception e) Debug.LogWarning($"Save corrupted, using defaults: e"); data = GetDefaultSave(); return false;
Want the full Unity package with an example save editor UI? Download the template here .