public static void SetItemSlots(Character character, ItemSlots slots) { GmSerializer serializer = new GmSerializer(); MemoryStream stream = new MemoryStream(); serializer.Serialize(stream, slots); character.itemSlotData = System.Convert.ToBase64String(stream.ToArray()); }
private byte[] Serialize(ClientMessage message) { MemoryStream stream = new MemoryStream(); serializer.Serialize(stream, message); //Serializer.Serialize (stream, message); return(stream.ToArray()); }
private static void Save(Characters characters) { MemoryStream stream = new MemoryStream(); GmSerializer serializer = new GmSerializer(); serializer.Serialize(stream, characters); PlayerPrefs.SetString("npcs", Convert.ToBase64String(stream.ToArray())); Debug.Log(characters.characters.Count + " npc characters saved"); }