Skip to content

Repository files navigation

Pathways

Pathways tells your game where to write and read save files. You still serialize your own data (JSON, binary, whatever you like) and call File.WriteAllText, JsonUtility, MemoryPack, etc. Pathways handles the rest: folder layout, naming, quick-save vs manual-save vs auto-save slots, and switching between separate playthroughs.

Installation · Quick start · Concepts · Save types · Auto-save · Profiles

Pathways Debug Window showing active profile, save files, and configuration

The Pathways Debug Window (Tools → Pathways → Debug Window). Inspect profiles, browse saves on disk, copy paths, and delete files while iterating in the Editor.


Installation

Requirements: Unity 2021.3 or newer.

  1. Open Window → Package Manager.
  2. Click +Add package from git URL…
  3. Paste:
https://github.com/Tirtstan/Pathways.git

Quick start

1. Point at a save folder and pick a profile

A profile could be a playthrough, level, world, campaign, lobby session, etc. Each profile gets its own subfolder within your storage root. LoadProfile only selects the active profile in memory; the folder is created on disk the first time you call GetPath and write a save.

usingTirt.Pathways;usingSystem.IO;usingUnityEngine;publicclassGameBootstrap:MonoBehaviour{privatevoidAwake(){Pathways.StorageLocation=Path.Combine(Application.persistentDataPath,"Saves");Pathways.LoadProfile("Northern_Forest");}}

2. Ask for a path, then save or load yourself

usingTirt.Pathways;usingSystem.IO;// Save: get a path, write your datastringpath=Pathways.GetPath(SaveType.Manual);File.WriteAllText(path,myJson);// Load: find the newest file, read your datastringlatest=Pathways.GetLatest();if(latest!=null)myJson=File.ReadAllText(latest);// List saves for a load-game menu (newest first)FileInfo[]saves=Pathways.GetSaves(SaveType.Manual);

See the sample scene (Samples/Examples) and SaveManager.cs for a full working example with JSON serialization.


Concepts

Storage layout

Everything lives under Pathways.StorageLocation. Each profile is a subfolder; each save is a file inside that folder. Profile folders only appear after the first save to that profile.

Saves/ ← Pathways.StorageLocation
├── Crater_Lakes/ ← one profile (one playthrough)
│ ├── Crater_Lakes_quicksave.sav
│ ├── Crater_Lakes_before_boss.sav
│ ├── Crater_Lakes_save_2026-07-04_15-30-00.sav
│ └── Crater_Lakes_auto_save_1.sav
└── Grasslands/ ← a different playthrough
└── Grasslands_quicksave.sav

Files are prefixed with the profile name so a single .sav (configurable) file is self-contained, you can move or share it without breaking anything.

The three API calls you'll use

MethodWhen to use it
GetPath(SaveType type)Saving: returns the path to write to
GetLatest(SaveType? type)Loading: returns the most recent existing file, or null
GetSaves(SaveType? type)UI: returns all matching files, newest first

All three operate on the active profile (set by LoadProfile or SetActiveProfile).


Save types

// Manual: creates a new file (timestamp if no name given)Pathways.GetPath(SaveType.Manual);// …_save_2026-07-04_15-30-00.savPathways.GetPath(SaveType.Manual,"phase_4");// …_phase_4.sav// Quick save: always the same file, overwritten each timePathways.GetPath(SaveType.QuickSave);// …_quicksave.sav// Auto save: cycles through numbered slots (see below)Pathways.GetPath(SaveType.AutoSave);// …_auto_save_1.sav

Pass a SaveType to GetLatest or GetSaves to filter by type, or omit it to include all types.


Auto-save

Pathways can fire a timer that asks you to save on a schedule. Subscribe to the event, write your data when it fires, and enable the timer:

privatevoidStart(){Pathways.OnAutoSavePathRequested+=OnAutoSaveRequested;Pathways.EnableAutoSave(interval:300f,slots:3);// every 5 min, 3 rotating slots}privatevoidOnAutoSaveRequested(stringpath){File.WriteAllText(path,myJsonData);}privatevoidOnDestroy(){Pathways.OnAutoSavePathRequested-=OnAutoSaveRequested;}

Auto-save slots rotate: once all slots are used, the oldest file gets overwritten next. You control the interval and slot count; Pathways only picks the path.


Profiles

Use profiles when your game has multiple independent playthroughs: separate worlds, campaigns, or player sessions.

Pathways.LoadProfile("Northern_Forest");// load and activatePathways.SetActiveProfile("Grasslands");// switch to anotherPathways.SelectRecentProfile();// switch to whichever was saved laststring[]ids=Pathways.GetAllProfileIds();// list all profiles on diskPathways.DeleteProfile("Crater_Lakes");// delete a profile and all its saves

About

A Unity package for managing data file pathways and directories without handling actual data persistence.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages