Documentation

Learn how to use NodeCanvas

Save & Load

A Blackboard can Save and Load its variables state in PlayerPrefs with ease. This means that you can possibly save the whole state of a Behaviour, or use it for any other purposes, like for example creating a save system. All variables of a blackboard are able to be saved and loaded in this specific way (in PlayPrefs), except UnityEngine Object references which are not possible to be saved/loaded into PlayerPrefs.

This can be done in code with these two simple methods.

string Save (string savekey)
Save the blackboard state in PlayerPrefs at the given saveKey. Returns the json string serialized.

bool Load (string saveKey)
Load the blackboard state previously saved in PlayerPrefs of the provided saveKey. Returns whether or not Load was successful.


Alternatively, you could also use the following methods to serialize/deserialize the blackboard variables to/from json and therefore use it with your own save system.

string Serialize (List<UnityEngine.Object> references, bool pretyJson = false)
Serialize the variables to json. Unity object references will be stored in the provided references list.

bool Deserialize (string json, List<UnityEngine.Object> references)
Deserialize the variables from the provided previously serialized json. Unity object references will be loaded from the provided references list.

Yes No Suggest edit
Suggest Edit

© Paradox Notion 2014-2024. All rights reserved.