private static void SetPlayerProfile(i01.Player.PlayerProfile playerProfile) { if (!File.Exists(PlayerProfilePath)) { CreateNewPlayerProfileFile(); } File.WriteAllText(PlayerProfilePath, JsonUtility.ToJson(playerProfile)); }
public static void SendObject(string key, JToken obj) { i01.Player.PlayerProfile playerProfile = PlayerProfileManager.PlayerProfile; Debug.Log(obj.ToString()); foreach (JProperty x in obj) { string name = x.Name; JToken value = x.Value; FieldInfo fieldInfo = typeof(i01.Player.PlayerProfile).GetField(name); fieldInfo.SetValue(playerProfile, value.ToObject(fieldInfo.FieldType)); } PlayerProfileManager.PlayerProfile = playerProfile; }
public static void SaveProfile(i01.Player.PlayerProfile profile) { PlayerProfileManager.PlayerProfile = profile; }