Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Saving and loading with Peristence data layer

Discussion in 'Game Foundation' started by Neray96, Dec 26, 2021.

  1. Neray96

    Neray96

    Joined:
    Sep 8, 2020
    Posts:
    2
    Hi,
    The current documentation states "The persistence data layer is a turn-key solution to save and load states to and from files."

    So, how can I do it? How can I save and load?
     
  2. metiscoda

    metiscoda

    Joined:
    Nov 18, 2013
    Posts:
    41
    I'm using GameFoundation 0.9.0 and the way you would do it in that would be to create a GF Initializer in your scene:
    Screen Shot 2021-12-29 at 12.06.17 PM.png

    The inspector will allow you to change the name of the file used to save and load your changes during play. ("Local Persistence Filename").
    Screen Shot 2021-12-29 at 12.07.05 PM.png

    The rest is done automatically by GF - changes are saved and loaded as they occur.
     
    Heathcliff001 and erika_d like this.