Example #1
0
    public static void Create()
    {
        gameSaveData gsd = ScriptableObject.CreateInstance <gameSaveData> ();

        string path = AssetDatabase.GenerateUniqueAssetPath("Assets/Resources/SaveData.asset");

        AssetDatabase.CreateAsset(gsd, path);
        AssetDatabase.SaveAssets();

        EditorUtility.FocusProjectWindow();
        Selection.activeObject = gsd;
    }
    // セーブデータの全て更新処理
    public static void SaveGameSaveDataAll()
    {
        SaveData = Resources.Load <gameSaveData> ("SaveData");

        // 最新攻略ステージ
        SaveData.LatestCaptureStage = ManagerSelectStage.LatestCaptureStage;

        // アイテム取得履歴
        SaveData.ItemAcquisitionRecord = ManagerSelectStage.ItemAcquisitionRecord;

        // BGM
        SaveData.Bgm = ManagerSelectStage.Bgm;
        // SE
        SaveData.Se = ManagerSelectStage.Se;
    }
    // セーブデータを全て取得処理
    public static void LoadGameSaveDataAll()
    {
        SaveData = Resources.Load <gameSaveData> ("SaveData");

        // 最新攻略ステージ
        ManagerSelectStage.LatestCaptureStage = SaveData.LatestCaptureStage;

        // アイテム取得履歴
        for (int i = 0; i < 99; i++)
        {
            ManagerSelectStage.ItemAcquisitionRecord[i] = SaveData.ItemAcquisitionRecord[i];
        }

        // BGM
        ManagerSelectStage.Bgm = SaveData.Bgm;
        // SE
        ManagerSelectStage.Se = SaveData.Se;
    }