• Manual
  • API Documentation
  • Guides
  • Saving and Loading Scene Objects

    Show / Hide Table of Contents
    • Introduction
    • Installation
    • Getting Started
    • Demos
    • The Save System API
    • Auto Save
    • Platforms
    • Security
    • Serialization
    • Supported Data Types
    • Migration
    • FAQ
    • Changelog
    • Extend
      • Overview
      • Converter
      • Encryption
      • Storage
    • Guides
      • Overview
      • Configuring Settings
      • Using Auto Save
      • Basic Saving and Loading
      • Saving and Loading Raw Data
      • Deleting the Data
      • Saving and Loading Images
      • Saving and Loading Scene Objects
      • Saving and Loading Assets
      • Saving and Loading Readonly Properties
    • Integrations
      • Overview
      • Google Play Games
      • Xbox Live
      • Bolt
      • Firebase
      • PlayFab
      • PlayMaker
      • Steam Auto-Cloud
      • Steamworks .NET
      • Facepunch Steamworks
      • Text Mesh Pro
    • Storage
      • Overview
      • Backup
      • Catalog
      • Meta Data
      • Built-in Storages
        • File
        • PlayerPrefs
        • Memory
      • Third-party Storages
        • Firebase
          • Realtime Database
          • Cloud Storage
          • Firestore
        • PlayFab
          • Entity Objects
          • Entity Files
          • User Data
        • Steam
          • Steamworks .NET
          • Facepunch Steamworks
        • Google Play
          • Saved Game
        • Xbox Live
          • Connected Storage

    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.

    Scene Reference Resolver Component

    You can also use the Window > Bayat > Core > Scene Reference Manager window for managing the scene references:

    Scene Reference Resolver Window

    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");
    }
    
    • Improve this Doc
    • 0 Comments
    In This Article
    • Getting Started