UI工具翻新
1. 增加UI工具 2. 增加设置页面 3. GameLoop更新 4. 导入ActionKit工具
This commit is contained in:
@@ -11,10 +11,8 @@ namespace AibisDream.Kit
|
||||
public class ConfigUtil : SingletonBase<ConfigUtil>
|
||||
{
|
||||
private const string CharacterConfigPath = "/Config/character.csv";
|
||||
private const string BaseConfigPath = "/Config/base_config.csv";
|
||||
private const string SpriteGroupPath = "/Config/sprite_group.json";
|
||||
|
||||
private Dictionary<string, string> _baseConfigDic;
|
||||
|
||||
private Dictionary<string, Character> _characters;
|
||||
private Dictionary<string, SpriteGroupConfig> _spriteConfigDict;
|
||||
|
||||
@@ -30,27 +28,10 @@ namespace AibisDream.Kit
|
||||
/// </summary>
|
||||
public override void OnSingletonInit()
|
||||
{
|
||||
InitBaseConfig();
|
||||
InitCharacterConfig();
|
||||
InitSpriteGroupConfig();
|
||||
}
|
||||
|
||||
private void InitBaseConfig()
|
||||
{
|
||||
var baseList = CsvUtil.Read(Application.streamingAssetsPath + BaseConfigPath);
|
||||
if (baseList.Count <= 0)
|
||||
{
|
||||
Debug.Log("基础配置不存在");
|
||||
}
|
||||
|
||||
// 基础配置只有key和value
|
||||
_baseConfigDic = new Dictionary<string, string>();
|
||||
foreach (var arr in baseList)
|
||||
{
|
||||
_baseConfigDic.Add(arr[0], arr[1]);
|
||||
}
|
||||
}
|
||||
|
||||
private void InitCharacterConfig()
|
||||
{
|
||||
var characterList = CsvUtil.ReadAsBean<Character>(Application.streamingAssetsPath + CharacterConfigPath);
|
||||
@@ -74,17 +55,6 @@ namespace AibisDream.Kit
|
||||
return _characters.TryGetValue(key, out character);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按key获取基础配置
|
||||
/// </summary>
|
||||
/// <param name="key">key</param>
|
||||
/// <param name="value">配置项</param>
|
||||
/// <returns>是否能获取</returns>
|
||||
public bool TryGetBaseConfig(string key, out string value)
|
||||
{
|
||||
return _baseConfigDic.TryGetValue(key, out value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存SpriteGroupConfig
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user