WXGame/box1/Assets/Script/JsonTab.cs
2024-11-05 18:15:49 +08:00

37 lines
727 B
C#

using System.Collections;
using System.Collections.Generic;
using System.IO;
using cfg;
using SimpleJSON;
using UnityEngine;
public class JsonTab
{
private static JsonTab instance;
public static JsonTab Instance
{
get { return instance; }
}
public Tables tables;
public JsonTab() // 这是构造函数
{
if (instance == null)
instance = this;
}
public void InitData(){
tables = new Tables(Loader);
}
private JSONNode Loader(string fileName)
{
string data = Resources.Load(fileName).ToString();
// File.ReadAllText(Application.streamingAssetsPath + "/" + fileName + ".json");
return JSON.Parse(data);
}
}