

FrogDataLib is a lightweight data persistence framework for YAPYAP mods. It allows developers to save and load custom mod data into "sidecar" files, preventing save game pollution and ensuring mod data stays synchronized with the user's active save slot.
%AppData%/LocalLow/maisonbap/YAPYAP/FrogData/, keeping vanilla saves clean.FrogDataContainer<T> pattern for easy serialization.See the full Example Project for more in-depth usage tips!
Your data class must inherit from FrogDataModel and be marked with the [Serializable] attribute.
using FrogDataLib.DataManagement;
using System;
[Serializable]
public class MyModData : FrogDataModel
{
public int PlayerKills;
public string FavoriteFrogName;
}
Create a container using a unique GUID (usually your mod's ID).
private FrogDataContainer<MyModData> _dataContainer;
void Awake()
{
_dataContainer = new FrogDataContainer<MyModData>("com.yourname.mymod");
// Subscribe to FrogDataLib events
FrogDataManager.OnBeginSaving += SaveMyData;
FrogDataManager.OnLoadCompleted += LoadMyData;
}
myData.FavoriteFrogName = "Gertrude";
Use the provided events to stay in sync with the game session.
// Called when the user clicks "Save" in-game
private void SaveMyData() =>
_dataContainer.SaveModData(myData);
// Called when a save slot is finished loading
private void LoadMyData()
{
MyModData data = _dataContainer.GetModData();
Debug.Log($"Loaded: {data.FavoriteFrogName}");
}
FrogDataLib uses an internal integer (8675309) to verify that Unity's JsonUtility didn't silently fail. If your model isn't marked [Serializable], the sentinel will be 0, and the frogs will refuse to save/load to prevent data loss.OnSessionEnded event to clear your local variables when a user returns to the Main Menu.