Esempio n. 1
0
        private static void SetPlayerProfile(i01.Player.PlayerProfile playerProfile)
        {
            if (!File.Exists(PlayerProfilePath))
            {
                CreateNewPlayerProfileFile();
            }

            File.WriteAllText(PlayerProfilePath, JsonUtility.ToJson(playerProfile));
        }
Esempio n. 2
0
        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;
        }
Esempio n. 3
0
 public static void SaveProfile(i01.Player.PlayerProfile profile)
 {
     PlayerProfileManager.PlayerProfile = profile;
 }