public void RegisterEnumerationType(CustomDbClass customDbClass) { customDbClass.RegisterTypeParser(typeof(LywColor), LywColor.Parse); customDbClass.RegisterTypeParser(typeof(LywVector2), LywVector2.Parse); customDbClass.RegisterTypeParser(typeof(LywVector3), LywVector3.Parse); customDbClass.RegisterTypeParser(typeof(LywRect), LywRect.Parse); AttributeType.Initialize(); customDbClass.RegisterTypeParser(typeof(AttributeType), AttributeType.GetTypeByName); customDbClass.RegisterTextParser(typeof(AttributeType), AttributeType.GetNameByType); MonsterType.Initialize(); customDbClass.RegisterTypeParser(typeof(MonsterType), MonsterType.GetTypeByName); customDbClass.RegisterTextParser(typeof(MonsterType), MonsterType.GetNameByType); MonsterSelfAdaptionType.Initialize(); customDbClass.RegisterTypeParser(typeof(MonsterSelfAdaptionType), MonsterSelfAdaptionType.GetTypeByName); customDbClass.RegisterTextParser(typeof(MonsterSelfAdaptionType), MonsterSelfAdaptionType.GetNameByType); }
public void Initialize(IDbAccessorFactory dbAccessorFactory, string subPath) { if (inited) { return; } inited = true; defaultPath = FileManager.GetPersistentDataPath(subPath); ConstructConfigDbPath(); SetAccessorFactory(dbAccessorFactory); if (customDbClass == null) { customDbClass = new CustomDbClass(); } RegisterEnumerationType(customDbClass); ConstValue.Initialize(); }