Restore destroyed Object
Before you start
Option A — “The object exists; just re-apply its saved state”
If you have a reference to the object
using Arawn.CrystalSave.Runtime;
using UnityEngine;
public class RestoreOne : MonoBehaviour
{
[SerializeField] GameObject target; // e.g., boss door in the scene
[SerializeField] int slotNumber = 1;
public void RestoreNow()
{
SaveManager.Instance.RestoreSingleGameObject(target, slotNumber);
}
}If you have a reference to the object
If you only know the UniqueID (string)
Re-apply from the currently loaded save (no slot I/O)
Option B — “The object was destroyed; respawn it from the save”
Restore one destroyed object
Restore all destroyed objects that still map to a prefab
Guard restore with a check
Working from “latest save slot” (handy utilities)
What exactly gets restored?
Common pitfalls & tips
Minimal example: “Reset room” button
Troubleshooting
Quick API cheat‑sheet
Last updated