コード例 #1
0
    public void SaveKeyboard()
    {
        Debug.Log("Saving..");
        BinaryFormatter bf = new BinaryFormatter();

        Debug.Log(userName);
        FileStream      file    = File.Create(Application.persistentDataPath + "/" + userName + "KeyboardInfo.dat");
        KeyboardDataSer keyData = new KeyboardDataSer();

        keyData.inputManagerList = new List <InputManager.INPUT_CLASS_FOR_DATA_STORAGE>();

        foreach (InputManager.INPUT_CLASS inputClass in InputManager.inputManagerList)
        {
            InputManager.INPUT_CLASS_FOR_DATA_STORAGE tempInputClass =
                new InputManager.INPUT_CLASS_FOR_DATA_STORAGE(inputClass.Input, buttonSer.returnButtonSer(inputClass.Key),
                                                              inputClass.Type, inputClass.Tag, inputClass.Name);

            keyData.inputManagerList.Add(tempInputClass);
        }

        bf.Serialize(file, keyData);
        file.Close();

        hasSaved = true;
        Debug.Log("Save Successful!");
    }
コード例 #2
0
    public void SaveKeyboard()
    {
        Debug.Log("Saving..");
        BinaryFormatter bf = new BinaryFormatter();
        Debug.Log(userName);
        FileStream file = File.Create(Application.persistentDataPath + "/" + userName + "KeyboardInfo.dat");
        KeyboardDataSer keyData = new KeyboardDataSer();
        keyData.inputManagerList = new List<InputManager.INPUT_CLASS_FOR_DATA_STORAGE>();

        foreach(InputManager.INPUT_CLASS inputClass in InputManager.inputManagerList)
        {
            InputManager.INPUT_CLASS_FOR_DATA_STORAGE tempInputClass =
                new InputManager.INPUT_CLASS_FOR_DATA_STORAGE(inputClass.Input, buttonSer.returnButtonSer(inputClass.Key),
                                            inputClass.Type, inputClass.Tag, inputClass.Name);

            keyData.inputManagerList.Add(tempInputClass);
        }

        bf.Serialize(file, keyData);
        file.Close();

        hasSaved = true;
        Debug.Log("Save Successful!");
    }