53 lines
1.6 KiB
C#
53 lines
1.6 KiB
C#
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();
|
|
|
|
return base.SaveDynamicData(_elements);
|
|
}
|
|
}
|