PC-20230316NUNE\Administrator 3afb2e3b86 临时提交
2024-08-17 14:12:46 +08:00

23 lines
611 B
C#

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);
}
}
}
}