23 lines
611 B
C#
Raw Permalink Normal View History

2024-08-17 14:12:46 +08:00
using System;
using System.Collections.Generic;
namespace BehaviorTreeSlayer
{
public class SlayerUtils
{
static Dictionary<Type, Func<string, object>> dic = new Dictionary<Type, Func<string, object>>();
public static Dictionary<Type, Func<string, object>> Dic => dic;
public static void RegistCustomParser<T>(Func<string, object> func)
{
Type key = typeof(T);
if (dic.ContainsKey(key))
{
dic[key] = func;
}
else
{
dic.Add(key, func);
}
}
}
}