2024-10-11 10:12:15 +08:00
|
|
|
|
|
|
|
using TableConfig;
|
|
|
|
using SimpleJSON;
|
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.IO;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace Ether
|
|
|
|
{
|
|
|
|
public static class TableProvider
|
|
|
|
{
|
|
|
|
private static string tableDir = Application.streamingAssetsPath + "/Tables";
|
|
|
|
private static Tables tables;
|
|
|
|
|
|
|
|
public static Tables Tables
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if (tables == null)
|
|
|
|
{
|
|
|
|
tables = new Tables(file => JSON.Parse(File.ReadAllText($"{tableDir}/{file}.json")));
|
|
|
|
}
|
|
|
|
return tables;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void Init()
|
|
|
|
{
|
|
|
|
tables = new Tables(file => JSON.Parse(File.ReadAllText($"{tableDir}/{file}.json")));
|
|
|
|
}
|
2024-10-27 04:03:15 +08:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 重置数据
|
|
|
|
/// </summary>
|
|
|
|
public static void ResetCounter()
|
|
|
|
{
|
|
|
|
tables = null;
|
|
|
|
}
|
2024-10-11 10:12:15 +08:00
|
|
|
}
|
|
|
|
}
|