Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class LegacyRecord
- {
- public string title;
- public string description; //This property will be shown in the Explorer
- public int highScore;
- public bool gameCompleted;
- public string characterClass;
- }
- public void SaveLegacyRecord()
- {
- LegacyRecord legacyRecord = new LegacyRecord()
- {
- title = "Game stats",
- description = "Completed the game, hight score of 1337, loves bread",
- highScore = 1337,
- gameCompleted = true,
- characterClass = "Rogue"
- };
- string legacyJson = JsonUtility.ToJson(legacyRecord);
- tCore.AddLegacyRecord(asset, TotemAssetType.avatar, legacyJson, (recordedLegacy) =>
- {
- Debug.Log("Legacy record added");
- });
- }
- public void ReadLegacyRecord()
- {
- tCore.GetLegacyRecords(asset, TotemAssetType.avatar, (retrievedLegacyRecords) =>
- {
- LegacyRecord legacyRecord = JsonUtility.FromJson<LegacyRecord>(retrievedLegacyRecords[0].data);
- Debug.Log(legacyRecord.description);
- }, "gameAddress");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement