Saving and Loading Scene Objects
Using the SceneReferenceResolver
component you can easily save and load scene objects by reference instead of serializing their values completely.
You can also use the Window > Bayat > Core > Scene Reference Manager window for managing the scene references:
Getting Started
First we should add the Scene Reference Resolver to the current scene:
Right click on the hierarchy and use the Bayat/Save System/Save System Manager menu to create the Save System Manager component and all the required components.
If you just want to create a single Scene Reference Resolver, use Bayat/Core/Scene Reference Resolver menu.
And now you can simply save and load your objects using the Save System API, for example:
public async void Save() {
var gameObjects = new GameObject[] { this.gameObject };
await SaveSystemAPI.SaveAsync("gameObjects.dat", gameObjects);
}
public async void Load() {
var gameObjects = await SaveSystemAPI.LoadAsync("gameObjects.dat");
}