private void InitShopLeg() { List <ItemSave> saveHeads = new List <ItemSave>(); for (int i = 0; i < Item_Legs.Count; i++) { ItemSave item = null; if (Item_Legs[i].idItem == 0 || Item_Legs[i].idItem == 1 || Item_Legs[i].idItem == 2) { item = new ItemSave(Item_Legs[i].idItem, false, false, true); } else { item = new ItemSave(Item_Legs[i].idItem, true, false, false); } saveHeads.Add(item); } ListItemSave ListSave = new ListItemSave(saveHeads); string json = JsonUtility.ToJson(ListSave); PlayerPrefs.SetString(Key_Shop_Leg, json); PlayerPrefs.Save(); }
private void InitShopHand() { List <ItemSave> saveHeads = new List <ItemSave>(); for (int i = 0; i < Item_Hands.Count; i++) { ItemSave item = null; if (Item_Hands[i].idItem == 0 || Item_Hands[i].idItem == 1 || Item_Hands[i].idItem == 2) { item = new ItemSave(Item_Hands[i].idItem, false, false, true); } else { item = new ItemSave(Item_Hands[i].idItem, true, false, false); } saveHeads.Add(item); } ListItemSave ListSave = new ListItemSave(saveHeads); string json = JsonUtility.ToJson(ListSave); PlayerPrefs.SetString(Key_Shop_Hand, json); PlayerPrefs.Save(); Debug.Log("Data Hand : " + JsonUtility.FromJson <ListItemSave>(PlayerPrefs.GetString(Key_Shop_Hand)).ListItems.Count); }
public Item(ItemSave itemSave) { //Base = ItemDatabase.Instance.Items.Find(x => x.uniqueIdentifier == itemSave.baseUid); try { Base = GameSettings.Instance.ItemDatabase.Content[itemSave.baseUid]; } catch (Exception e) { Debug.LogError($"Falha em deserializar id {itemSave.baseUid}"); throw new DeserializationFailureException(typeof(ItemSave)); } }
public void SaveShopLeg() { List <ItemSave> listItem = new List <ItemSave>(); for (int i = 0; i < Item_Legs.Count; i++) { ItemSave item = new ItemSave(Item_Legs[i].idItem, Item_Legs[i].isBuy, Item_Legs[i].isUsing, Item_Legs[i].isFree); listItem.Add(item); } ListItemSave ListSave = new ListItemSave(listItem); Save(ListSave, Key_Shop_Leg); }
public List <ItemSave> Save() { List <ItemSave> saveData = new List <ItemSave>(); for (int i = 0; i < items.Count; i++) { if (slots.Count <= i || slots[i] == null || items[i] == null || slots[i].GetComponentInChildren <ItemData>() == null) { continue; } ItemSave it = new ItemSave(items[i].ToItem_JSON(), slots[i].GetComponentInChildren <ItemData>().Count); // Help.print("ItemSave", it); saveData.Add(it); } return(saveData); }
/// <summary> /// Generate items drops - varies level and choose an amount based on a range /// </summary> public List <ItemSave> GenerateItemDrops(int level, Vector2Int dropRange) { List <ItemSave> items = new List <ItemSave>(); List <int> chestSlots = new List <int>(); for (int i = 0; i < ChestInventory.instance.chestSlots.Count; i++) { chestSlots.Add(i); } int amount = Random.Range(dropRange.x, dropRange.y + 1); for (int i = 0; i < amount; i++) { int index = Random.Range(0, ItemDropQueue.Count); ItemDropTypes itemType = ItemDropQueue[index]; ItemDropQueue.Remove(itemType); int randomLevel = Mathf.Clamp(level + Random.Range(-1, 2), 1, 30); int randomSlot = chestSlots[Random.Range(0, chestSlots.Count)]; chestSlots.Remove(randomSlot); ItemSave item; switch (itemType) { case ItemDropTypes.RareArtifact: item = new ItemSave(new ItemStack(GetRandomItemByLevel(randomLevel + 5, artifacts), 1), randomSlot); break; case ItemDropTypes.Equipment: item = new ItemSave(new ItemStack(GetRandomItemByLevel(randomLevel, equipment), 1), randomSlot); break; default: item = new ItemSave(new ItemStack(GetRandomItemByLevel(randomLevel, artifacts), 1), randomSlot); break; } items.Add(item); if (ItemDropQueue.Count == 0) { FillItemDropQueue(); } } return(items); }
public static Item BuildInstance(ItemSave itemSave) { if (itemSave.baseUid == -1) { return(null); } if (itemSave is EquippableSave equippableSave) { return(new Equippable(equippableSave)); } if (itemSave is ConsumableSave consumableSave) { return(new Consumable(consumableSave)); } if (itemSave is MiscItemSave miscItemSave) { return(new MiscItem(miscItemSave)); } return(null); }
public void Read(Actor actor, SaveModes mode) { Log.Write("Writing appearance to file", "AppearanceFile"); using IMemory <int> modelTypeMem = actor.GetMemory(Offsets.Main.ModelType); this.ModelType = modelTypeMem.Value; if (!actor.IsCustomizable()) { return; } using IMemory <Appearance> appearanceMem = actor.GetMemory(Offsets.Main.ActorAppearance); using IMemory <Equipment> equipmentMem = actor.GetMemory(Offsets.Main.ActorEquipment); using IMemory <Weapon> mainHandMem = actor.GetMemory(Offsets.Main.MainHand); using IMemory <Weapon> offHandMem = actor.GetMemory(Offsets.Main.OffHand); Appearance appearance = appearanceMem.Value; Equipment equipment = equipmentMem.Value; Weapon mainHand = mainHandMem.Value; Weapon offHand = offHandMem.Value; this.SaveMode = mode; if (this.IncludeSection(SaveModes.EquipmentGear, mode)) { using IMemory <Color> mainHandTintMem = actor.GetMemory(Offsets.Main.MainHandColor); using IMemory <Vector> mainHandScaleMem = actor.GetMemory(Offsets.Main.MainHandScale); using IMemory <Color> offHandTintMem = actor.GetMemory(Offsets.Main.OffhandColor); using IMemory <Vector> offHandScaleMem = actor.GetMemory(Offsets.Main.OffhandScale); this.MainHand = new WeaponSave(); this.MainHand.DyeId = mainHand.Dye; this.MainHand.ModelBase = mainHand.Base; this.MainHand.ModelSet = mainHand.Set; this.MainHand.ModelVariant = mainHand.Variant; this.MainHand.Color = mainHandTintMem.Value; this.MainHand.Scale = mainHandScaleMem.Value; this.OffHand = new WeaponSave(); this.OffHand.DyeId = offHand.Dye; this.OffHand.ModelBase = offHand.Base; this.OffHand.ModelSet = offHand.Set; this.OffHand.ModelVariant = offHand.Variant; this.OffHand.Color = offHandTintMem.Value; this.OffHand.Scale = offHandScaleMem.Value; this.HeadGear = new ItemSave(equipment.Head); this.Body = new ItemSave(equipment.Chest); this.Hands = new ItemSave(equipment.Arms); this.Legs = new ItemSave(equipment.Legs); this.Feet = new ItemSave(equipment.Feet); } if (this.IncludeSection(SaveModes.EquipmentAccessories, mode)) { this.Ears = new ItemSave(equipment.Ear); this.Neck = new ItemSave(equipment.Neck); this.Wrists = new ItemSave(equipment.Wrist); this.LeftRing = new ItemSave(equipment.LFinger); this.RightRing = new ItemSave(equipment.RFinger); } if (this.IncludeSection(SaveModes.AppearanceHair, mode)) { using IMemory <Color> hairTintColorMem = actor.GetMemory(Offsets.Main.HairColor); using IMemory <Color> hairGlowColorMem = actor.GetMemory(Offsets.Main.HairGloss); using IMemory <Color> highlightTintColorMem = actor.GetMemory(Offsets.Main.HairHiglight); this.Hair = appearance.Hair; this.EnableHighlights = appearance.EnableHighlights; this.HairTone = appearance.HairTone; this.Highlights = appearance.Highlights; this.HairTint = hairTintColorMem.Value; this.HairGlow = hairGlowColorMem.Value; this.HighlightTint = highlightTintColorMem.Value; } if (this.IncludeSection(SaveModes.AppearanceFace, mode) || this.IncludeSection(SaveModes.AppearanceBody, mode)) { this.Race = appearance.Race; this.Gender = appearance.Gender; this.Tribe = appearance.Tribe; this.Age = appearance.Age; } if (this.IncludeSection(SaveModes.AppearanceFace, mode)) { using IMemory <Color> leftEyeColorMem = actor.GetMemory(Offsets.Main.LeftEyeColor); using IMemory <Color> rightEyeColorMem = actor.GetMemory(Offsets.Main.RightEyeColor); using IMemory <Color> limbalRingColorMem = actor.GetMemory(Offsets.Main.LimbalColor); using IMemory <Color> lipTintMem = actor.GetMemory(Offsets.Main.MouthColor); using IMemory <float> lipGlossMem = actor.GetMemory(Offsets.Main.MouthGloss); this.Head = appearance.Head; this.REyeColor = appearance.REyeColor; this.LimbalEyes = appearance.LimbalEyes; this.FacialFeatures = appearance.FacialFeatures; this.Eyebrows = appearance.Eyebrows; this.LEyeColor = appearance.LEyeColor; this.Eyes = appearance.Eyes; this.Nose = appearance.Nose; this.Jaw = appearance.Jaw; this.Mouth = appearance.Mouth; this.LipsToneFurPattern = appearance.LipsToneFurPattern; this.FacePaint = appearance.FacePaint; this.FacePaintColor = appearance.FacePaintColor; this.LeftEyeColor = leftEyeColorMem.Value; this.RightEyeColor = rightEyeColorMem.Value; this.LimbalRingColor = limbalRingColorMem.Value; this.LipTint = new Color4(lipTintMem.Value, lipGlossMem.Value); } if (this.IncludeSection(SaveModes.AppearanceBody, mode)) { using IMemory <Color> skinColorMem = actor.GetMemory(Offsets.Main.SkinColor); using IMemory <Color> skinGlowMem = actor.GetMemory(Offsets.Main.SkinGloss); this.Height = appearance.Height; this.Skintone = appearance.Skintone; this.EarMuscleTailSize = appearance.EarMuscleTailSize; this.TailEarsType = appearance.TailEarsType; this.Bust = appearance.Bust; this.SkinTint = skinColorMem.Value; this.SkinGlow = skinGlowMem.Value; } }
public void Save() { var status = new Status { position = player.position, HP = player.HP, Defense = player.Defense, Attack = player.Attack }; var objectSave = new ObjectSave { SceneName = game_manager_script.SceneName, SceneNameBefore = game_manager_script.SceneNameBefore, SceneHistroy = game_manager_script.SceneHistroy, WannnaDestroyEnemy = game_manager_script.wanna_destroy_enemy, WannaDestroyItem = itemDatabase.wanna_destroy_item_id }; foreach (ItemList item in itemDatabase.items) { AttackSave.Add(item.itemPower); HPIncreaseSave.Add(item.itemHPInCrease); DefenseSave.Add(item.itemDefense); NameSave.Add(item.ItemName); DescriptionSave.Add(item.itemDesc); spriteSave.Add(item.itemIcon); LifeStealSave.Add(item.itemLifeSteal); IDSave.Add(item.itemID); speedSave.Add(item.itemAttackSpeed); eTypeSave.Add(item.elementtype); iTypeSave.Add(item.itemType); } for (int i = 0; i < gear_set_script.Head.Count; i++) { GearIDSave.Add(gear_set_script.GearID[i]); GearNameSave.Add(gear_set_script.GearName[i]); GearDefenseSave.Add(gear_set_script.GearDefense[i]); GearHeadSave.Add(gear_set_script.Head[i]); GearBodySave.Add(gear_set_script.Body[i]); GearLegSave.Add(gear_set_script.Leg[i]); GearArmsLeftSave.Add(gear_set_script.ArmsLeft[i]); GearArmsRightSave.Add(gear_set_script.ArmsRight[i]); } var GearStatusSave = new GearStatusSave { GearID = GearIDSave, GearName = GearNameSave, GearDefense = GearDefenseSave, GearHead = GearHeadSave, GearLeg = GearLegSave, GearBody = GearBodySave, GearArmLeft = GearArmsLeftSave, GearArmRight = GearArmsRightSave }; var itemsSave = new ItemSave { Attack = AttackSave, HPIncrease = HPIncreaseSave, Defense = DefenseSave, Name = NameSave, Description = DescriptionSave, sprite = spriteSave, ID = IDSave, eType = eTypeSave, iType = iTypeSave, ItemCount = itemDatabase.items.Count, LifeSteal = LifeStealSave, speed = speedSave }; var GearSave = new GearSave { //武器シリーズ weaponID = gear_manager_script.weaponID, weaponName = gear_manager_script.weaponName, weaponPower = gear_manager_script.weaponPower, WeaponAttackSpeed = gear_manager_script.WeaponAttackSpeed, //ここはギアシリーズ GearDefense = gear_manager_script.GearDefense, GearID = gear_manager_script.GearID, GearName = gear_manager_script.GearName, //ここは装備画像を入れるところ GearArmLeft = gear_manager_script.GearArmLeft, GearArmRight = gear_manager_script.GearArmRight, GearBody = gear_manager_script.GearBody, GearLeg = gear_manager_script.GearLeg, GearHead = gear_manager_script.GearHead }; PlayerPrefsObject.SetObject("Status", status); PlayerPrefsObject.SetObject("objectSave", objectSave); PlayerPrefsObject.SetObject("ItemSave", itemsSave); PlayerPrefsObject.SetObject("GearSave", GearSave); PlayerPrefsObject.SetObject("GearStatusSave", GearStatusSave); }
public async Task <IHttpActionResult> PutItemSave(Guid id, ItemSave itemSave) { HashSet <Category> categories = new HashSet <Category>(); if (itemSave.Item.Description != null) { string[] categoryValuesArray = itemSave.Item.Description.Split('#'); foreach (var categoryValues in categoryValuesArray) { string categoryValue = categoryValues; if (categoryValue != "" && categories.Count(x => x.Value == categoryValue) == 0) { Category category = await db.Categories.FirstOrDefaultAsync(x => x.Value == categoryValues.Trim()); if (category == null) { category = new Category { Value = categoryValues.Trim() }; db.Categories.Add(category); await db.SaveChangesAsync(); } categories.Add(category); } } } foreach (Category category in categories) { ItemCategory itemCategory = await db.ItemCategories.FirstOrDefaultAsync(x => x.OwnerId == id && x.TargetId == category.Id); if (itemCategory == null) { db.ItemCategories.Add(new ItemCategory { StartDate = DateTime.Now, OwnerId = itemSave.Item.Id, TargetId = category.Id }); await db.SaveChangesAsync(); } } foreach (ItemCategory itemCategory in db.ItemCategories.Where(x => x.OwnerId == id).ToArray()) { Category category = categories.FirstOrDefault(x => x.Id == itemCategory.TargetId); if (category == null) { db.ItemCategories.Remove(itemCategory);/* * itemCategory.EndDate = DateTime.Now; * itemCategory.ArchivedDate = itemCategory.EndDate; * ItemCategory existedItemCategory = await db.ItemCategories.FindAsync(itemCategory.Id); * db.Entry(existedItemCategory).CurrentValues.SetValues(itemCategory);*/ } } Item existedItem = await db.Items.FindAsync(id); db.Entry(existedItem).CurrentValues.SetValues(itemSave.Item); await db.SaveChangesAsync(); return(Ok(existedItem)); }
public SlotItemSave(ItemSave itemSave, int SoLuong) { iTemSave = itemSave; Soluong = SoLuong; }
// Save the player's inventory info public void Save() { // For Inventory Slots // Iterate through array of Slots for (int i = 0; i < Inventory.Instance.m_slotList.Length; ++i) { // Check if there are items if (Inventory.Instance.m_slotList[i].GetComponent <Slot>().m_item.Count == 0) { // If no items // Name of save string saveName = "InventorySlot" + i.ToString(); // Set in PlayerPrefs to nothing PlayerPrefs.SetString(saveName, ""); continue; } // Get the item Item theItem = Inventory.Instance.m_slotList[i].GetComponent <Slot>().m_item.Peek(); // Set item count int itemCount = Inventory.Instance.m_slotList[i].GetComponent <Slot>().m_item.Count; switch (theItem.m_itemType) { case Item.ItemType.Weapon_Rune: case Item.ItemType.Armour_Rune: // Cast item as rune Rune theRune = (Rune)theItem; // Create a save ItemSave _runeSave = new ItemSave(theRune.m_runePower, (int)theRune.m_itemType, 1, theRune.m_itemName); // Name of save string runeSaveName = "InventorySlot" + i.ToString(); // Convert save to json string jsonRuneSave = JsonUtility.ToJson(_runeSave); // Set in PlayerPrefs PlayerPrefs.SetString(runeSaveName, jsonRuneSave); Debug.Log(jsonRuneSave); break; case Item.ItemType.None: break; default: // Create a save ItemSave _itemSave = new ItemSave((int)theItem.m_itemType, itemCount, theItem.m_itemName); // Name of save string saveName = "InventorySlot" + i.ToString(); // Convert save to json string jsonSave = JsonUtility.ToJson(_itemSave); // Set in PlayerPrefs PlayerPrefs.SetString(saveName, jsonSave); break; } } // For Rune Slots // Iterate through array of rune slots for (int i = 0; i < RuneMenu.Instance.m_runeSlotList.Length; ++i) { // Check if there are items if (RuneMenu.Instance.m_runeSlotList[i].GetComponent <Slot>().m_item.Count == 0) { // If no items // Name of save string saveName = "RuneSlot" + i.ToString(); // Set in PlayerPrefs to nothing PlayerPrefs.SetString(saveName, ""); continue; } // Get the item Rune theRune = (Rune)RuneMenu.Instance.m_runeSlotList[i].GetComponent <Slot>().m_item.Peek(); // Create a save ItemSave _runeSave = new ItemSave(theRune.m_runePower, (int)theRune.m_itemType, 1, theRune.m_itemName); // Name of save string runeSaveName = "RuneSlot" + i.ToString(); // Convert save to json string jsonRuneSave = JsonUtility.ToJson(_runeSave); // Set in PlayerPrefs PlayerPrefs.SetString(runeSaveName, jsonRuneSave); } }
// Load the player's inventory info public void Load() { // For Inventory Slots // Iterate through the whole inventory for (int i = 0; i < Inventory.Instance.m_slotList.Length; ++i) { // Save name string saveName = "InventorySlot" + i.ToString(); // The saved item string theSave = PlayerPrefs.GetString(saveName); // Check if there are any saves under the save name if (theSave != null && theSave.Length > 0) { // Get item from json string ItemSave theItem = JsonUtility.FromJson <ItemSave>(theSave); // Check if item is null if (theItem != null) { // Iterate to give the amount of objects for (int j = 0; j < theItem.GetCount(); ++j) { // Check if it is rune type or not if (theItem.GetRunePower() == -1) { // Cast as ShopItem type ShopItem _item = (ShopItem)m_database.GetItem(theItem.GetName()); // Push into the slot item stack Inventory.Instance.m_slotList[i].GetComponent <Slot>(). m_item.Push(_item); } else { // Cast as Rune type Rune _rune = new Rune(); _rune.SetRune(theItem.GetRunePower(), theItem.GetItemType()); // Push into the slot item stack Inventory.Instance.m_slotList[i].GetComponent <Slot>().m_item.Push(_rune); } } // Spawn item Inventory.Instance.m_slotList[i].GetComponent <Slot>().m_icon.gameObject.SetActive(true); Inventory.Instance.m_slotList[i].GetComponent <Slot>().m_icon.sprite = Inventory.Instance.m_slotList[i].GetComponent <Slot>().m_item.Peek().m_itemIcon; // Check if more than 1 of the item if (theItem.GetCount() > 1) { // Spawn item count Inventory.Instance.m_slotList[i].GetComponent <Slot>().m_countText.gameObject.SetActive(true); Inventory.Instance.m_slotList[i].GetComponent <Slot>().m_countText.text = theItem.GetCount().ToString(); } // Set slot to not empty Inventory.Instance.m_slotList[i].GetComponent <Slot>().SetIsEmpty(false); } else { // If item is null Debug.Log("The Load has a problem"); } } } // For Rune Slots // Iterate through rune menu for (int i = 0; i < RuneMenu.Instance.m_runeSlotList.Length; ++i) { // Save name string saveName = "RuneSlot" + i.ToString(); // The saved item string theSave = PlayerPrefs.GetString(saveName); // Check if there are any saves under the save name if (theSave != null && theSave.Length > 0) { // Get item from json string ItemSave theItem = JsonUtility.FromJson <ItemSave>(theSave); // Check if item is null if (theItem != null) { // Iterate to give the amount of objects for (int j = 0; j < theItem.GetCount(); ++j) { // Cast as Rune type Rune _rune = new Rune(); _rune.SetRune(theItem.GetRunePower(), theItem.GetItemType()); // Push into the slot item stack RuneMenu.Instance.m_runeSlotList[i].GetComponent <Slot>().m_item.Push(_rune); } // Spawn item RuneMenu.Instance.m_runeSlotList[i].GetComponent <Slot>().m_icon.gameObject.SetActive(true); RuneMenu.Instance.m_runeSlotList[i].GetComponent <Slot>().m_icon.sprite = RuneMenu.Instance.m_runeSlotList[i].GetComponent <Slot>().m_item.Peek().m_itemIcon; // Check if more than 1 of the item if (theItem.GetCount() > 1) { // Spawn item count RuneMenu.Instance.m_runeSlotList[i].GetComponent <Slot>().m_countText.gameObject.SetActive(true); RuneMenu.Instance.m_runeSlotList[i].GetComponent <Slot>().m_countText.text = theItem.GetCount().ToString(); } // Set slot to not empty RuneMenu.Instance.m_runeSlotList[i].GetComponent <Slot>().SetIsEmpty(false); } else { // If item is null Debug.Log("The Load has a problem"); } } } }
public void Write() { //Save Time/Events time = Session.master.time; currentDay = Session.master.day; completedEvents = Session.master.completedEvents; failedEvents = Session.master.failedEvents; foreach (string key in Session.master.dayEvents.Keys){ List<string> dayEvents = Session.master.dayEvents[key]; DaySave dayInfo = new DaySave(); dayInfo.dayName = key; dayInfo.events = dayEvents; days.Add(dayInfo); } //Save Location foreach(string key in Session.master.locations.Keys){ LocationSave locationSave = new LocationSave(); SessionLocation sessionLocation = Session.master.locations[key]; locationSave.id = key; locationSave.accessable = sessionLocation.accessable?"true":"false"; locationSave.owner = sessionLocation.owner; locationSave.state = sessionLocation.state; mapSave.Add(locationSave); } //Save People foreach(string key in Session.master.people.Keys){ PersonSave personSave = new PersonSave(); SessionPerson sessionPerson = Session.master.people[key]; personSave.id = key; personSave.location = sessionPerson.location; personSave.reputationPeople = new List<string>(); personSave.reputations = new List<float>(); foreach(KeyValuePair<string,Person> person in Population.master.peopleDictionary){ if(person.Value.id != key){ personSave.reputationPeople.Add(person.Value.id); personSave.reputations.Add(sessionPerson.reputations[person.Value.id]); } } personSave.position = new float[3] {sessionPerson.position.x, sessionPerson.position.y, sessionPerson.position.z}; personSave.health = sessionPerson.health; personSave.energy = sessionPerson.energy; personSave.hunger = sessionPerson.hunger; personSave.money = sessionPerson.money; personSave.power = sessionPerson.power; personSave.speed = sessionPerson.speed; personSave.range = sessionPerson.range; personSave.state = sessionPerson.state; personSave.emotion = sessionPerson.emotion; peopleSave.Add(personSave); } //Save Items foreach(string key in Session.master.items.Keys){ ItemSave itemSave = new ItemSave(); SessionItem sessionItem = Session.master.items[key]; itemSave.id = key; itemSave.name = key; if(sessionItem.owner != null){ itemSave.owner = sessionItem.owner; } else { itemSave.owner = null; } if(sessionItem.holder != null){ itemSave.holder = sessionItem.holder; } else { itemSave.holder = null; } itemSave.location = sessionItem.location; itemSave.position = new float[3] {sessionItem.position.x, sessionItem.position.y, sessionItem.position.z}; itemSave.properties = sessionItem.properties; itemSave.health = sessionItem.health; itemSave.uses = sessionItem.uses; itemSave.cost = sessionItem.cost; itemSave.power = sessionItem.power; itemSave.range = sessionItem.range; itemSave.state = sessionItem.state; inventorySave.Add(itemSave); } //Save Pictures foreach(SessionPicture sessionPicture in Session.master.pictures){ PictureSave pictureSave = new PictureSave(); pictureSave.position = new float[3] {sessionPicture.position.x, sessionPicture.position.y, sessionPicture.position.z}; pictureSave.subject = sessionPicture.subject; pictureSave.rotation = sessionPicture.rotation; picturesSave.Add(pictureSave); } //Save Pins foreach(SessionPin sessionPin in Session.master.pins){ PinSave pinSave = new PinSave(); pinSave.position = new float[3] {sessionPin.position.x, sessionPin.position.y, sessionPin.position.z}; pinSave.colour = new float[3] {sessionPin.colour.r, sessionPin.colour.g, sessionPin.colour.b}; pinsSave.Add(pinSave); } //Save PostIts foreach(SessionPostIt sessionPostIt in Session.master.postits){ PostItSave postitSave = new PostItSave(); postitSave.position = new float[3] {sessionPostIt.position.x, sessionPostIt.position.y, sessionPostIt.position.z}; postitSave.message = sessionPostIt.message; postitSave.rotation = sessionPostIt.rotation; postitsSave.Add(postitSave); } //Save Strings foreach(SessionString sessionString in Session.master.strings){ StringSave stringSave = new StringSave(); stringSave.startPoint = new float[3] {sessionString.startPoint.x, sessionString.startPoint.y, sessionString.startPoint.z}; stringSave.endPoint = new float[3] {sessionString.endPoint.x, sessionString.endPoint.y, sessionString.endPoint.z}; stringsSave.Add(stringSave); } }