first commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using YandexQuest.Models;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class ClientDataService
|
||||
{
|
||||
public Client data
|
||||
{
|
||||
get
|
||||
{
|
||||
var prefsData = PlayerPrefs.GetString("data", string.Empty);
|
||||
return prefsData == string.Empty ? null : JsonConvert.DeserializeObject<Client>(prefsData);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
var prefsData = JsonConvert.SerializeObject(value);
|
||||
PlayerPrefs.SetString("data", prefsData);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user