38 lines
936 B
C#
38 lines
936 B
C#
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
[Serializable]
|
|
public class GlobalValueData
|
|
{
|
|
public string s_ID;
|
|
public float n_Value;
|
|
}
|
|
|
|
public class table_GlobalValue : table_base
|
|
{
|
|
public static table_GlobalValue Ins;
|
|
List<GlobalValueData> m_GlobalValueData;
|
|
Dictionary<string, float> dic_Data = new Dictionary<string, float>();
|
|
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
Ins = this;
|
|
}
|
|
|
|
protected override void Start()
|
|
{
|
|
m_GlobalValueData = JsonConvert.DeserializeObject<List<GlobalValueData>>(json_last);
|
|
for (int i = 0; i < m_GlobalValueData.Count; i++)
|
|
{
|
|
var temp = m_GlobalValueData[i];
|
|
dic_Data.Add(temp.s_ID, temp.n_Value);
|
|
}
|
|
|
|
base.Start();
|
|
}
|
|
|
|
public int Get_Int(string id) { return (int)dic_Data[id]; }
|
|
public float Get_Float(string id) { return dic_Data[id]; }
|
|
} |