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