Getting Started

1. Setting Up Serialization Saver Settings

  • Go to Assets > Create > Glitch9 > SerializationSaver > Settings to create a SerializationSaverSettings asset.

  • Configure the settings according to your project needs, such as specifying the JSON path for backups and enabling autosave

2. Using SnapBehaviour & SnapScriptableObject

■ SnapBehaviour

Attach the SnapBehaviour script to any GameObject you wish to serialize. Customize the SnapBehaviour script to include any properties or fields you want to be serialized.

using Glitch9.Toolkits.SerializationSaver;

public class MyCustomBehaviour : SnapBehaviour
{
// Add your serializable fields here
}

■ SnapScriptableObject

Create a new ScriptableObject by extending SnapScriptableObject and define any serializable fields you need.

using Glitch9.Toolkits.SerializationSaver;

[CreateAssetMenu(fileName = "MyCustomData", menuName = "MyCustom/MyCustomData")]
public class MyCustomData : SnapScriptableObject
{
// Add your serializable fields here
}

Serialization Actions

  • Backup: Manually trigger a backup of your GameObject or ScriptableObject through the Inspector or programmatically by calling BackupToJson().

  • Restore: Restore the state of an object from a JSON backup through the Inspector or by calling RestoreFromJson().

  • AutoSave: Enable auto-saving in SerializationSaverSettings to automatically backup objects when changes are detected.

Viewing and Managing Snapshots

Open the SnapshotWindow from the Unity Editor to view, restore, or delete snapshots. This window allows you to manage the states of serialized objects with ease.

Last updated