IndieGame/client/Assets/Scripts/Config/Table/TableProvider.cs
DOBEST\zhaoyingjie f242607587 初始化工程
2024-10-11 10:12:15 +08:00

34 lines
792 B
C#

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")));
}
}
}