/// <summary> /// Sets sticker to placed. /// </summary> /// <param name="typeOfSticker">Type of sticker to set placed</param> public void OnStickerPlaced(DataType.StickerType typeOfSticker) { // Copy current struct to a new one StickerStats newSticker = stickerStats[typeOfSticker]; // Modify desired variable newSticker.isStickerPlaced = true; // Save changes to new struct stickerStats[typeOfSticker] = newSticker; // Save changes to save data SaveGame(); }
/// <summary> /// Unlocks a sticker for the corresponding game. /// </summary> /// <param name="game">Type of sticker to unlock.</param> public void ActivateSticker(DataType.StickerType sticker) { // Copy current struct to a new one StickerStats newSticker = stickerStats[sticker]; // Modify desired variable if (!newSticker.isStickerUnlocked) { newSticker.isStickerUnlocked = true; // Save changes to new struct stickerStats[sticker] = newSticker; // Save changes to save data SaveGame(); } }