Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

Help Wanted The name "Game Foundation" doesn't exist in the current context.

Discussion in 'Game Foundation' started by Melanzue, Dec 9, 2020.

  1. Melanzue

    Melanzue

    Joined:
    May 12, 2020
    Posts:
    8
    Hi! I'm trying out Game Foundation and I want to save all the changes that are made in Runtime. So I found this code in the official tutorial:
    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using UnityEngine.GameFoundation;
    4. public class SaveGame : MonoBehaviour
    5. {
    6.      IDataPersistence localPersistence;
    7.      void Awake()
    8.      {
    9.          // choose what format you want to use
    10.          JsonDataSerializer dataSerializer = new JsonDataSerializer();
    11.          // choose where and how the data is stored
    12.          localPersistence = new LocalPersistence(dataSerializer);
    13.          // tell Game Foundation to initialize using this
    14.          // persistence system. Only call Initialize once per session.
    15.          GameFoundation.Initialize(localPersistence);
    16.      }
    17.      public void Save()
    18.      {
    19.          GameFoundation.Save(localPersistence);
    20.      }
    21.      public void Load()
    22.      {
    23.          GameFoundation.Load(localPersistence);
    24.      }
    25. }
    But I'm having this problem:

    Any help will be appreciated!
     
  2. U_AdrienPDB

    U_AdrienPDB

    Unity Technologies

    Joined:
    Aug 14, 2019
    Posts:
    7
    Melanzue and erika_d like this.
  3. Melanzue

    Melanzue

    Joined:
    May 12, 2020
    Posts:
    8
    @U_AdrienPDB , thank you so much! I've been searching for the updated tutorial but couldn't find it on my own. Now I can finally continue working on my project!
     
    tony_c-unity3d and erika_d like this.
unityunity