Scriptum/Assets/Scripts/REFACTORING/Application/Panel/Equipment/EquipmentDataLoader.cs

53 lines
1.6 KiB
C#
Raw Permalink Normal View History

2022-11-24 03:03:30 +01:00
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class EquipmentDataLoader : SceneBaseDataLoader<IndexValuePair<EquipmentPanelSlotsTypeEnum, EquippableItemPrefabAsset>>
{
public EquipmentDataLoader(string _objectListName, string _objectFolderName)
{
SaveModelSystem = new SaveEquipmentManager();
SaveModelSystem.ObjectFolderName = _objectFolderName;
SaveModelSystem.ObjectListName = _objectListName;
}
protected override List<IndexValuePair<EquipmentPanelSlotsTypeEnum, EquippableItemPrefabAsset>> LoadGenericData()
{
SaveModelSystem.Path = PathBuilder.BuildSavePath().GetString();
return SaveModelSystem.LoadModelList();
}
protected override bool SaveGenericData(List<IndexValuePair<EquipmentPanelSlotsTypeEnum, EquippableItemPrefabAsset>> _elements)
{
SaveModelSystem.Path = PathBuilder.BuildSavePath().GetString();
try
{
SaveModelSystem.SaveModelList(_elements);
return true;
}
catch (Exception e) { Debug.LogError(e.Message); }
return false;
}
protected override List<IndexValuePair<EquipmentPanelSlotsTypeEnum, EquippableItemPrefabAsset>> LoadDynamicData()
{
SaveModelSystem.Path = PathBuilder.BuildSavePath().GetString();
return SaveModelSystem.LoadModelList();
}
protected override bool SaveDynamicData(List<IndexValuePair<EquipmentPanelSlotsTypeEnum, EquippableItemPrefabAsset>> _elements)
{
SaveModelSystem.Path = PathBuilder.BuildSavePath().GetString();
2022-11-27 21:28:55 +01:00
return base.SaveDynamicData(_elements);
2022-11-24 03:03:30 +01:00
}
}