2024-06-03 18:26:03 +00:00
|
|
|
using BlueWater.Players.Combat;
|
|
|
|
using Sirenix.OdinInspector;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace BlueWater
|
|
|
|
{
|
|
|
|
public enum SaveStage
|
|
|
|
{
|
2024-06-13 16:46:37 +00:00
|
|
|
None = 0,
|
2024-06-21 22:11:53 +00:00
|
|
|
TitanSlime = 3,
|
|
|
|
Rhinoceros = 4,
|
2024-06-28 08:44:52 +00:00
|
|
|
SandMole = 5,
|
|
|
|
GhostBarrel = 6
|
2024-06-03 18:26:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public class DataManager : Singleton<DataManager>
|
|
|
|
{
|
|
|
|
public SaveStage CurrentSaveStage { get; set; }
|
|
|
|
|
|
|
|
[field: Title("Inventory")]
|
|
|
|
[field: SerializeField] public CombatInventory CombatInventory { get; private set; } = new();
|
|
|
|
|
|
|
|
public int Gold { get; set; } = 0;
|
|
|
|
|
|
|
|
|
|
|
|
// /// <summary>
|
|
|
|
// /// Dictionary 초기화 함수
|
|
|
|
// /// </summary>
|
|
|
|
// private Dictionary<string, T> CreateDictionaryFromList<T>(List<T> list, int capacity) where T : IIdx
|
|
|
|
// {
|
|
|
|
// var newDictionary = new Dictionary<string, T>(capacity);
|
|
|
|
//
|
|
|
|
// foreach (var item in list)
|
|
|
|
// {
|
|
|
|
// newDictionary.Add(item.Idx, item);
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// return newDictionary;
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// [ContextMenu("Json To So")]
|
|
|
|
// public void MakeDataSoFromJson()
|
|
|
|
// {
|
|
|
|
// NpcDataSo.npcDataList = GetJsonData<List<NpcData>>("JSON/customer_table.json");
|
|
|
|
//
|
|
|
|
// #if UNITY_EDITOR_OSX || UNITY_EDITOR_WIN
|
|
|
|
// EditorUtility.SetDirty(NpcDataSo);
|
|
|
|
// #endif
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// private static T GetJsonData<T>(string path)
|
|
|
|
// {
|
|
|
|
// var jsonString = File.ReadAllText(SystemPath.GetPath(path));
|
|
|
|
// var data = JsonConvert.DeserializeObject<T>(jsonString);
|
|
|
|
// return data;
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|