unity – Save Script Doesn’t Save Item Variables

I’ve been working on an RPG videogame, and I have been trying to implement a Save button into my game, which is supposed to save the player’s itemAmount variable, which is in another script, called ItemInformation. I retrieve the itemAmount variable at Start() by getting the script from the itemHolder GameObject. I plan to use this script in multiple GameObjects, because I use the same variable (itemAmount) with different values in different GameObjects. For some reason, I don’t receive any errors or warnings in the Console. Here is my script to the Saving System:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;

public class InventorySave : MonoBehaviour
{
    // Public variables for inventory and health
    private GameObject itemHolder;
    private ItemInformation myItemAmount;

    // Initiates before the first frame
    void Start()
    {
        // Gets components for the player variables
        itemHolder = transform.gameObject;
        myItemAmount = itemHolder.GetComponent<ItemInformation>();
    }

    // Function that will be called when player saves game from pause menu
    public void SaveGame()
    {
        // Creates file to store variables
        BinaryFormatter bf = new BinaryFormatter();
        FileStream file = File.Create(Application.persistentDataPath + "/SaveData.dat");
        SaveData data = new SaveData();

        // Gets the player data
        data.itemSave = myItemAmount.itemAmount;

        // Writes player data to file and encrypts it
        bf.Serialize(file, data);
        file.Close();
    }
}

// Holds data that is to be saved
(Serializable)
class SaveData
{
    // Variables for save file
    public int itemSave;
}

Save whole email in SharePoint library as .eml file using MS Flow and open it outlook

I want to save the O365 email (whole email itself) to SharePoint (online) document library as a .eml file and open up in office outlook.

I have followed the approach given in this url:
How to save outlook office 365 email body in SharePoint Online Document Library using Microsoft Flow?

https://powerusers.microsoft.com/t5/General-Flow-Discussion/Save-email-to-Sharepoint-document-library-full-email/m-p/4440/highlight/true#M995
https://flow.microsoft.com/en-us/blog/outlook-connector-more/
https://powerusers.microsoft.com/t5/General-Flow-Discussion/Save-email-to-Sharepoint-document-library-full-email/m-p/4440/highlight/true

I have found that the email gets saved in the library, but when I open it from the library (downloading from lirabry using outlook), the file opens but shows no any content (white email screen). The extension of the file is .eml. Can anybody suggest, how can i open this email in outlook with content?

enter image description here

enter image description here

enter image description here

Since I am forcibly changing the extension, probably content are lost. Note sure. Any Idea?

android 10 – Camera doesn’t save with new SD card and how to decrypt files from old SD card

it seems I had a bad idea yesterday. I got a new SD card for my Fairphone 3+ (running Fairphone OS/Android 10). There was already an SD card inserted I assumed not to be in use. So I turned off the phone, exchanged the cards, booted the device and when asked to extend the phones memory I confirmed that.

Now I have two problems:

  • I’m missing a couple of pictures.

    I wondered if these were on the old (luckily only 8GB) SD card and recognized that there are two partitions on it: android_meta and android_expand. As far as I learned, this means the SD card also was used as phone memory extension and thus encrypted. And the posts on Android Enthusiasts read like the phone has only one encryption key and won’t recognize the old SD card anymore.

  • The Camera can’t save pictures anymore.

    Whenever I take a photo I’m able to immediately open it by tapping its preview. Then I see a black picture, I’m told its size is 0 bytes and it’s located in /storage/emulated/0/DCIM/Camera. Using the cx File Explorer I’m able to open that directory, but it’s empty. And I’m not able to create files there.

    Using the ADB shell I was able to ls -la /storage the directory and got this:

    total 7
    drwxr-xr-x  4 root root        80 2020-12-21 06:52 .
    drwxr-xr-x 21 root root      4096 2009-01-01 01:00 ..
    drwx--x--x  4 root sdcard_rw 3488 2021-01-12 21:38 emulated
    drwxr-xr-x  2 root root        60 1970-01-01 01:00 self
    

    So only root is able to write in /storage/emulated. BTW: “total 7”?

Currently I’m trying to find out the following:

  • is it possible to decrypt the pictures on the old SD card? Would be fine for me if it meant some work 🙂
  • is the encryption key for the old SD card still on the phone or could I reset the phone without making things worse regarding the old encrypted SD card?
  • is the phone in a bad state?
    • The Camera doesn’t save pictures.
    • All other apps seem to work as expected.
    • The SD card overview in the Memory settings tell me there are apps on the new SD card (about 5GB). But when I tap the App category to get all apps listed, the list is empty.
    • When I eject the SD card, a couple of apps start, but only show a blank canvas.
  • if the phone is in a bad state: could this easily be fixed? If yes, how?

Would be great to get some hints. Thank you very much in advance.

unity – How to Save Same Variable with Different Values in Multiple GameObjects?

I’ve been working on a game and have successfully created an RPG Inventory System. In my system, I have a script that uses public floats and ints, which are connected to multiple slots that show the amount of that item. So basically, I have multiple GameObjects that use the same variable, but have different values. I was wondering whether there was a way to create a saving system, because I don’t know whether it is possible. Here’s my code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
 
public class ItemInformation : MonoBehaviour
{
    // These are the assets for the item to change
    public Text nameText;
    public Text descriptionText;
    public Text regenText;
    public Text amountText;
 
    // These are the variables that change with the different items
    public string itemName;
    public string itemDescription;
    public float itemRegeneration;
   public int itemAmount;
   
    // Starts on awake
    void Awake()
    {
        // Function to change the object's information and such
        nameText.text = itemName;
        descriptionText.text = itemDescription;
        regenText.text = "HEALS " + itemRegeneration + "HP";
    }
 
    // Updates on every frame
    void Update()
    {
        // Shows amount of item left
        amountText.text = "HAVE:" + itemAmount;
    }
}

json rpc – What data i can save?

i’m make one application about bitcoin, and I’m searching that data i can save, I’m read that the public key i can save in my database and privit key no, but i dont know, what more data i can save, I explain?, I’m would like to guide me, I have also read about getblock, but I don’t know what it really is.

To be more specific, I would like to know exactly what data I have to save in the database and what performs each of the aforementioned functions of bitcoin.

savegame – Unity – Save and load “Snapshots” of game for debugging?

I’m relatively new to Unity debugging, and I’ve got an issue that happens every so often about 2 minutes into playing through a scene. If I can do the following, it would save me a lot of time debugging:

  1. Pause the scene
  2. Save the snapshot
  3. Modify some code
  4. Play the snapshot saved in step 2
  5. Repeat 3-4

Is this at all possible with Unity, or should I just modify my code to running “closer” to the point I’m trying to debug?

command line – Cannot save or exit in sudoeditor

I am new using sudoeditor and I just want to edit sources.list file and then exit. However, after editing the file, I cannot save or exit. First I press ESC and then try to type the activated cursor at the bottom line, :q or :wq. However, it does not work (I cannot type this bottom line, it gives (ESC : unbound) and similar messages).

I also tried some functşion keys e.g. F4 and F3, or Ctrl + X, but unfortunately cannot exit with & without saving. So, how can I do this?

keyboard – Save/Don’t Save Menus No Longer Respond to Tab and Spacebar (post Big Sur)

Prior to Big Sur (OS 11.1), I could use tab to move between the options (buttons) in the type of pop-up menu shown in the image, and spacebar to select an option. For example, in the menu here I could a) press spacebar and have this email ‘Save’ and b) use tab to transition the highlighted option to ‘Don’t Save’.

Now, neither of these work, which I don’t like bcs. I prefer to use the keyboard. I can’t seem to find an option to reenable them (or work around the issue). Any ideas?

big sur save menu