Beispiel #1
0
    public static void _CharLoad(int _FileNumber, LoadButtonSC LBSC)
    {
        BinaryFormatter _BF  = new BinaryFormatter();
        FileStream      file = File.Open(Application.persistentDataPath + "/CharSave" + _FileNumber + ".dat", FileMode.Open);
        CharSaveCon     data = (CharSaveCon)_BF.Deserialize(file);

        LBSC._Scene         = data._Scene;
        LBSC._HP_Max        = data._HP_Max;
        LBSC._PlayTime      = data._PlayTime;
        LBSC._SwordMax      = data._SwordMax;
        LBSC._Money         = data._Money;
        LBSC._HaveVessel    = data._HaveVessel;
        LBSC._SlashAtkLv    = data._SlashAtkLv;
        LBSC._ShotAtkLv     = data._ShotAtkLv;
        LBSC._AtkSpeedLv    = data._AtkSpeedLv;
        LBSC._WarpLv        = data._WarpLv;
        LBSC._SwordSizeLv   = data._SwordSizeLv;
        LBSC._PermanentFlag = data._PermanentFlag;
        file.Close();
        LBSC._ChangeText();
    }
Beispiel #2
0
    public static void _CharSave()
    {
        Lumia_SC        _LSC = StageManagerSC._LumiaInst.GetComponent <Lumia_SC>();
        BinaryFormatter _BF  = new BinaryFormatter();
        FileStream      file = File.Create(Application.persistentDataPath + "/CharSave" + _LSC._FileNumber + ".dat");
        CharSaveCon     data = new CharSaveCon();

        data._Scene         = _LSC._SavedScene;
        data._HP_Max        = _LSC._Hitbox.GetComponent <LumiaHitboxSC>()._HP_Max;
        data._PlayTime      = _LSC._PlayTime;
        data._SwordMax      = _LSC._SwordMax;
        data._Money         = _LSC._Money;
        data._HaveVessel    = _LSC._HaveVessel;
        data._SlashAtkLv    = _LSC._SlashAtkLv;
        data._ShotAtkLv     = _LSC._ShotAtkLv;
        data._AtkSpeedLv    = _LSC._AtkSpeedLv;
        data._WarpLv        = _LSC._WarpLv;
        data._SwordSizeLv   = _LSC._SwordSizeLv;
        data._PermanentFlag = _LSC._PermanentFlag;

        _BF.Serialize(file, data);
        file.Close();
        Debug.Log("캐릭터 데이터가 " + _LSC._FileNumber + "번 파일에 저장되었습니다." + data._HP_Max);
    }