/// <summary> /// 将汉字转换为怪兽种族 /// </summary> /// <param name="value"></param> /// <returns></returns> public static MonsterType GetMonsterTypeByString(string value) { MonsterTypeConfig config = ConfigManager.GetConfigByName("MonsterType") as MonsterTypeConfig; int count = config.GetRecordCount(); for (int i = 0; i < count; i++) { if (config.GetRecordById(i).value == value) { return((MonsterType)i); } } return(0); }
/// <summary> /// 将怪兽种族转换为汉字 /// </summary> /// <param name="propertyType"></param> /// <returns></returns> public static string GetStringByMonsterType(MonsterType monsterType) { MonsterTypeConfig config = ConfigManager.GetConfigByName("MonsterType") as MonsterTypeConfig; return(config.GetRecordById((int)monsterType).value); }