The Luna Replay
DataPrefs.Fetch API allows you to cache a value during capture and fetch it during replay.
The Type parameter of this function can be any serializable type accepted by
Unlike barriers this function call order can change between capture and replay.
This API can be used if you wish to store some consistent data between capture and replay. Between each launch, this data might vary (i.e. data on disk is different), and the
DataPrefs API ensures consistency.
For example, if you are retrieving game data from:
- A 3rd party library
- A native extension
- Game server
- Device memory/disk
In some scenarios, you may need to request data from the same API multiple times, in which case you cannot use a single Data Prefs variable name.
For example, if your fetch and use data from a server during gameplay, it will not be possible to replay this in Luna Playground and the server's response can also change. Therefore, you can store the response during the time of capture to be used during replays