using Bright.Serialization;
using Config;
using UnityEngine;
///
/// 鲁班配置表管理器
///
public class ConfigManager:SingletonManager
{
///
/// 表数据
///
private Tables tables;
public Tables Tables
{
get
{
if(tables==null)
{
Init();
}
return tables;
}
}
///
/// 加载配置
///
public void Init()
{
var tablesCtor = typeof(Tables).GetConstructors()[0];
System.Delegate loader = new System.Func((file) =>
{
TextAsset text = Resources.Load(file);
byte[] ret = text.bytes;
return new ByteBuf(ret);
});
tables = (Tables)tablesCtor.Invoke(new object[] { loader });
}
///
/// 得到车大小类型
///
public E_CarSizeType GetE_CarSizeType(string carID)
{
return (E_CarSizeType)System.Enum.Parse(typeof(E_CarSizeType), tables.TbSkinCarConfig.Get(carID).SizeType);
}
}