private void InitSpellSlotConfigCsv(string stPath) { if (slotDict != null || slotDict.Count > 0) { return; } if (!File.Exists(stPath)) { return; } ScpReader reader = new ScpReader(stPath, true, 2); for (int i = 0; i < reader.GetRecordCount(); i++) { int nCol = 0; //读取表中记录的数据类型(HeroGemPageSettingConfig) int nHeroID = reader.GetInt(i, nCol, 0); int nGemPageIndex = reader.GetInt(i, nCol++, 0); HeroSlotItem item = new HeroSlotItem(); const int slotNumCol = 13; item.slotNum = reader.GetInt(i, slotNumCol, 0); item.skillIDList = new List <int>(); for (int n = 1; n <= item.slotNum; n++) { int skillID = reader.GetInt(i, slotNumCol + n, 0); item.skillIDList.Add(skillID); } slotDict.Add(nHeroID, item); } }
// 比赛脚本 private void LoadLegendCupConfig(string stPath) { ScpReader reader = new ScpReader(stPath, true, 2); m_cupConfig = new Dictionary <int, SSchemeLegendCupConfig>(); for (int i = 0; i < reader.GetRecordCount(); i++) { SSchemeLegendCupConfig cupInfo = new SSchemeLegendCupConfig(); cupInfo.nConfigID = reader.GetInt(i, (int)ECupConfigCol.ECCC_COL_CUP_CUPID, 0); cupInfo.sCupConfigName = reader.GetString(i, (int)ECupConfigCol.ECCC_COL_CUP_NAME, ""); cupInfo.nNeedRoundNum = reader.GetInt(i, (int)ECupConfigCol.ECCC_COL_CUP_NEEDROUND, 0); cupInfo.nMaxKinNum = reader.GetInt(i, (int)ECupConfigCol.ECCC_COL_CUP_MAXKINNUM, 0); cupInfo.nCupDetailID = reader.GetInt(i, (int)ECupConfigCol.ECCC_COL_CUP_CONFIGID, 0); string[] strDeadline = reader.GetString(i, (int)ECupConfigCol.ECCC_COL_CUP_DEADLINE, "").Split(';'); if (strDeadline != null && strDeadline.Length > 0) { cupInfo.nDeadline = new int[strDeadline.Length]; for (int j = 0; j < strDeadline.Length; ++j) { //cupInfo.nDeadline[j] = Convert.ToInt32(strDeadline[j]); Int32.TryParse(strDeadline[j], out cupInfo.nDeadline[j]); } } cupInfo.nCreateNeedMoney = reader.GetInt(i, (int)ECupConfigCol.ECCC_COL_CUP_CREATENEEDMONEY, 0); cupInfo.nRegistNeedMoney = reader.GetInt(i, (int)ECupConfigCol.ECCL_COL_CUP_REGISTNEEDMONEY, 0); cupInfo.nRegistHighestMoney = reader.GetInt(i, (int)ECupConfigCol.ECCL_COL_CUP_REGISTHIGHESTMONEY, 0); cupInfo.nPrizeConfigID = reader.GetInt(i, (int)ECupConfigCol.ECCC_COL_CUP_PRIZECONFIGID, 0); cupInfo.bIsFree = reader.GetInt(i, (int)ECupConfigCol.ECCC_COL_CUP_ISFREE, 0) > 0; cupInfo.nMiniStartCount = reader.GetInt(i, (int)ECupConfigCol.ECCC_COL_CUP_MINI_START_KINNUM, 0); cupInfo.sCupConfigViewName = reader.GetString(i, (int)ECupConfigCol.ECCC_COL_CUP_VIEW_NAME, ""); m_cupConfig[cupInfo.nConfigID] = cupInfo; } }
public void Load(string strPath) { m_dicSchemeSceneEffectNodeData = new Dictionary <int, SSchemeSceneEffectNodeData>(); ScpReader reader = new ScpReader(strPath, true, 1); for (int i = 0; i < reader.GetRecordCount(); i++) { SSchemeSceneEffectNodeData sConfig = new SSchemeSceneEffectNodeData(); sConfig.eSceneEffectID = reader.GetInt(i, (int)ESceneEffectNodeConfig.SEN_ID, 0); sConfig.nSceneEffectDuration = reader.GetInt(i, (int)ESceneEffectNodeConfig.SEN_Duration, 0); sConfig.strSceneEffectPath = reader.GetString(i, (int)ESceneEffectNodeConfig.SEN_Path, string.Empty); if (m_dicSchemeSceneEffectNodeData.ContainsKey(sConfig.eSceneEffectID)) { Trace.LogWarning("有相同的场景特效ID" + sConfig.eSceneEffectID + "表第" + i + "行"); } else { m_dicSchemeSceneEffectNodeData.Add(sConfig.eSceneEffectID, sConfig); } } reader.Dispose(); reader = null; }
private void InitCameraConfigCsv(string stPath) { ScpReader reader = new ScpReader(stPath, true, 2); CameraConfigTable = new Hashtable(); for (int i = 0; i < reader.GetRecordCount(); i++) { int index = reader.GetInt(i, (int)CamConfig.EMT_INDEX, 0); int heroID = reader.GetInt(i, (int)CamConfig.EMT_HEROTYPE, 0); int mapID = reader.GetInt(i, (int)CamConfig.EMT_MAPTYPE, 0); SoldierCamera.CameraParam[] caminfo = new SoldierCamera.CameraParam[4]; int modeAttributeCount = 8;//每一项有8个参数 for (int mode = 0; mode < 4; mode++) { caminfo[mode] = new SoldierCamera.CameraParam(); caminfo[mode].curDistance = reader.GetInt(i, mode * modeAttributeCount + (int)CamConfig.EMT_USER_DEFAULTDISTANCE, 0); Vector2 disRange = new Vector2(); disRange.x = reader.GetInt(i, mode * modeAttributeCount + (int)CamConfig.EMT_USER_MINDISTANCE, 0); disRange.y = reader.GetInt(i, mode * modeAttributeCount + (int)CamConfig.EMT_USER_MAXDISTANCE, 0); caminfo[mode].distanceRange = disRange; caminfo[mode].curPitchAngle = reader.GetInt(i, mode * modeAttributeCount + (int)CamConfig.EMT_USER_DEFAULTANGLE, 0); Vector2 angleRange = new Vector2(); angleRange.x = reader.GetInt(i, mode * modeAttributeCount + (int)CamConfig.EMT_USER_MINANGLE, 0); angleRange.y = reader.GetInt(i, mode * modeAttributeCount + (int)CamConfig.EMT_USER_MAXANGLE, 0); caminfo[mode].pitchAngleRange = angleRange; caminfo[mode].targetOffset = reader.GetFloat(i, mode * modeAttributeCount + (int)CamConfig.EMT_USER_TARGETOFFSET, 0); caminfo[mode].FOV = reader.GetInt(i, mode * modeAttributeCount + (int)CamConfig.EMT_USER_FOV, 0); } CameraConfigTable[mapID * MAX_HERO_TYPE + heroID] = caminfo; } }
// 初始化csv表 protected void InitHeroAIConfigCsv(string stPath) { // string stSchemeAllText = File.ReadAllText(stPath); ScpReader reader = new ScpReader(stPath, true, 2); allHeroAIConfigTable = new Hashtable(); for (int i = 0; i < reader.GetRecordCount(); i++) { SSchemeHeroAIConfig sConfig = new SSchemeHeroAIConfig(); sConfig.nBattleFieldID = reader.GetInt(i, (int)HeroAI.EMT_BATTLEFIELDID, 0); sConfig.nHeroId = reader.GetInt(i, (int)HeroAI.EMT_HEROID, 0); sConfig.szAIIDArray = reader.GetString(i, (int)HeroAI.EMT_AI_IDLIST, ""); sConfig.szAIRankArray = reader.GetString(i, (int)HeroAI.EMT_AI_RANKLIST, ""); sConfig.szAIDESArray = reader.GetString(i, (int)HeroAI.EMT_AI_DESLIST, ""); sConfig.bIsOpen = reader.GetInt(i, (int)HeroAI.EMT_AI_ISOPEN, 0) == 1? true: false; // 配置检查 string szAIDescList = sConfig.szAIDESArray; string[] AIDescArrayStr = szAIDescList.Split(';'); int nAIDescArrayLength = AIDescArrayStr.Length; string szAIIDList = sConfig.szAIIDArray; string[] AIIDArrayStr = szAIDescList.Split(';'); int nAIIDArrayLength = AIIDArrayStr.Length; if (nAIDescArrayLength != nAIIDArrayLength) { Trace.LogError("配置出错 请检查 HeroAIConfig.csv 位置:=(" + (i + 1) + ")行"); } int keyID = sConfig.nBattleFieldID * KEY_ID_BASE + sConfig.nHeroId; allHeroAIConfigTable[keyID] = sConfig; } }
/// <summary> /// 初始化技能提示 /// </summary> /// <param name="strDefaultViewConfigPath"></param> private void InitAboutShowSpellPromptScheme(string strDefaultViewConfigPath) { string strLabelDescriptionPath = strDefaultViewConfigPath + MobaSchemesConfig.SHOW_SPELL_PROMPT; ScpReader ShowSpellPromptReader = new ScpReader(strLabelDescriptionPath, true, 2); ShowSpellPromptTable = new Hashtable(); for (int i = 0; i < ShowSpellPromptReader.GetRecordCount(); i++) { SSchemeShowSpellPrompt data = new SSchemeShowSpellPrompt(); data.nID = ShowSpellPromptReader.GetInt(i, (int)EShowSpellPrompt.ESSP_ID, -1); if (data.nID == -1) { break; } data.nSpellID = ShowSpellPromptReader.GetInt(i, (int)EShowSpellPrompt.ESSP_SpellID, 0); data.nSlotID = ShowSpellPromptReader.GetInt(i, (int)EShowSpellPrompt.ESSP_SlotID, 0); ShowSpellPromptTable.Add(data.nID, data); } ShowSpellPromptReader.Dispose(); }
private void LoadGuideTypeConfig(string stPath) { ScpReader reader = new ScpReader(stPath, true, 2); m_guideTypeDic = new Dictionary <int, SSchemeGuideType>(); for (int i = 0; i < reader.GetRecordCount(); i++) { int nTypeId = reader.GetInt(i, (int)EConsumptionGuideConfig.ECGC_COL_TYPE, 0); string strGuideName = reader.GetString(i, (int)EConsumptionGuideConfig.ECGC_COL_NAME, ""); string strGuideTitle = reader.GetString(i, (int)EConsumptionGuideConfig.ECGC_COL_TITLE, ""); string strGuideDesc = reader.GetString(i, (int)EConsumptionGuideConfig.ECGC_COL_DESC, ""); int nWndId = reader.GetInt(i, (int)EConsumptionGuideConfig.ECGC_COL_WND, 0); if (!m_guideTypeDic.ContainsKey(nTypeId)) { SSchemeGuideType guideType = new SSchemeGuideType(); guideType.nTypeId = nTypeId; guideType.strGuideName = strGuideName; guideType.strGuideTitle = strGuideTitle; guideType.guideWndList = new List <SSchemeGuideWnd>(); m_guideTypeDic.Add(nTypeId, guideType); } SSchemeGuideWnd guideWnd = new SSchemeGuideWnd(); guideWnd.nGuideDesc = strGuideDesc; guideWnd.nGuideWnd = nWndId; m_guideTypeDic[nTypeId].guideWndList.Add(guideWnd); } }
public void Load(string strPath) { m_personModelConfigs = new List <SSchemePersonModelData>(); ScpReader reader = new ScpReader(strPath, true, 2); for (int i = 0; i < reader.GetRecordCount(); i++) { SSchemePersonModelData data = new SSchemePersonModelData(); data.nHeroID = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_HEROID, 0); data.nHeroType = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_HEROTYPE, 0); data.nOperationType = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_OPERATIONTYPE, 0); data.nHeroCharacter = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_HEROCHARACTER, 0); data.nSex = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_SEX, 0); data.nDefaultSkinID = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_DEFAULTSKINID, 0); data.szHeroName = reader.GetString(i, (int)EMPersonModelConfig.EMPMC_HERONAME, ""); data.szHeroTitle = reader.GetString(i, (int)EMPersonModelConfig.EMPMC_HEROTITLE, ""); data.nMiniMapIcon = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_MINIMAPICON, 0); data.nViewDistance = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_VIEWDISTANCE, 0); data.nHeroSwitch = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_HEROSWITCH, 0); data.szTotalSkinID = reader.GetString(i, (int)EMPersonModelConfig.EMPMC_TOTALSKINID, ""); data.nHeroUnLockLv = reader.GetInt(i, (int)EMPersonModelConfig.EMPMC_HEROUNLOCKLV, 0); m_personModelConfigs.Add(data); } reader.Dispose(); reader = null; }
// 任务脚本 private void LoadSeasonConfig(string strPath) { ScpReader reader = new ScpReader(strPath, true, 2); m_mapSeasonPrizeConfig = new Dictionary <int, Dictionary <int, SSchemeSeasonPrizeConfig> >(); for (int i = 0; i < reader.GetRecordCount(); i++) { int nCol = 0; SSchemeSeasonPrizeConfig node = new SSchemeSeasonPrizeConfig(); node.nPrizeConfigID = reader.GetInt(i, nCol++, 0); node.szSeasonDesc = reader.GetString(i, nCol++, ""); node.nRankGrade = reader.GetInt(i, nCol++, 0); node.szGradeDesc = reader.GetString(i, nCol++, ""); string[] strNormalPrizeList = reader.GetString(i, nCol++, "").Split(';'); if (strNormalPrizeList != null && strNormalPrizeList.Length > 0) { node.arrNormalPrize = new int[strNormalPrizeList.Length]; for (int j = 0; j < strNormalPrizeList.Length; j++) { Int32.TryParse(strNormalPrizeList[j], out node.arrNormalPrize[j]); } } string[] strExtraConditionList = reader.GetString(i, nCol++, "").Split(';'); if (strExtraConditionList != null && strExtraConditionList.Length > 0) { node.arrExtraCondition = new int[strExtraConditionList.Length]; for (int j = 0; j < strExtraConditionList.Length; j++) { Int32.TryParse(strExtraConditionList[j], out node.arrExtraCondition[j]); } } string[] strExtraPrizeList = reader.GetString(i, nCol++, "").Split(';'); if (strExtraPrizeList != null && strExtraPrizeList.Length > 0) { node.arrExtraPrize = new int[strExtraPrizeList.Length]; for (int j = 0; j < strExtraPrizeList.Length; j++) { Int32.TryParse(strExtraPrizeList[j], out node.arrExtraPrize[j]); } } node.nAccountScore = reader.GetInt(i, nCol++, 0); node.szNormalCondition = reader.GetString(i, nCol++, ""); node.szExtralCondition = reader.GetString(i, nCol++, ""); if (m_mapSeasonPrizeConfig.ContainsKey(node.nPrizeConfigID) == false) { Dictionary <int, SSchemeSeasonPrizeConfig> dicPrize = new Dictionary <int, SSchemeSeasonPrizeConfig>(); m_mapSeasonPrizeConfig.Add(node.nPrizeConfigID, dicPrize); } m_mapSeasonPrizeConfig[node.nPrizeConfigID].Add(node.nRankGrade, node); } }
private void InitWarBgmConfigCsv(string path) { ScpReader reader = new ScpReader(path, true, 2); warBgmConfigDic = new Dictionary <int, List <SSchemeWarBgmConfig> >(); for (int i = 0; i < reader.GetRecordCount(); i++) { int nCol = 0; int configID = reader.GetInt(i, nCol++, 0); SSchemeWarBgmConfig sConfig = new SSchemeWarBgmConfig(); sConfig.soundID = reader.GetInt(i, nCol++, 0); sConfig.playCount = reader.GetInt(i, nCol++, 0); sConfig.playDelay = reader.GetFloat(i, nCol++, 0); sConfig.playInterval = reader.GetFloat(i, nCol++, 0); List <SSchemeWarBgmConfig> warBgmList; if (!warBgmConfigDic.TryGetValue(configID, out warBgmList)) { warBgmList = new List <SSchemeWarBgmConfig>(); warBgmConfigDic.Add(configID, warBgmList); } warBgmConfigDic[configID].Add(sConfig); } reader.Dispose(); reader = null; }
// 初始化csv表 protected void InitMatchRoomCustomerConfigCsv(string stPath) { // string stSchemeAllText = File.ReadAllText(stPath); ScpReader reader = new ScpReader(stPath, true, 2); for (int i = 0; i < reader.GetRecordCount(); i++) { SSchemeMatchRoomCustomer sConfig = new SSchemeMatchRoomCustomer(); sConfig.nID = reader.GetInt(i, (int)CreateRoomCustomer.ERC_ID, 0); sConfig.MapDes = reader.GetString(i, (int)CreateRoomCustomer.ERC_MAPDES, ""); sConfig.MapDetailDes = reader.GetString(i, (int)CreateRoomCustomer.ERC_MAPDETAILDES, ""); sConfig.PictrueID = reader.GetInt(i, (int)CreateRoomCustomer.ERC_PICTRUE_ID, 0); sConfig.strPersonCountListDes = reader.GetString(i, (int)CreateRoomCustomer.ERC_PERSONCOUNT_DES, ""); sConfig.strMatchTypeList = reader.GetString(i, (int)CreateRoomCustomer.ERC_MATCHTYPE_LIST, ""); // 配置检查 string[] PersonCountStr = sConfig.strPersonCountListDes.Split(';'); int nDescArrayLength = PersonCountStr.Length; string[] AIIDArrayStr = sConfig.strMatchTypeList.Split(';'); int nArrayLength = AIIDArrayStr.Length; if (nDescArrayLength != nArrayLength) { Trace.LogError("配置出错 请检查 MatchRoomCustomer.csv 位置:=(" + (i + 1) + ")行"); } sConfig.bIsOpen = reader.GetInt(i, (int)CreateRoomCustomer.ERC_ISOPEN, 0) == 1 ? true : false; if (allMatchRoomCustomerTable.ContainsKey(sConfig.nID)) { Trace.LogError("重复id 检查配置MatchRoomCustomer.csv!id =" + sConfig.nID); } allMatchRoomCustomerTable.Add(sConfig.nID, sConfig); } }
// 载入商城广告页脚本 private void LoadPointShopADPageConfig(string stPath) { m_adConfig = new List <SSchemePointShopADConfig>(); ScpReader reader = new ScpReader(stPath, true, 2); for (int i = 0; i < reader.GetRecordCount(); i++) { SSchemePointShopADConfig config = new SSchemePointShopADConfig(); int nIndex = 0; config.nID = reader.GetInt(i, nIndex++, 0); config.strTitle = reader.GetString(i, nIndex++, ""); config.strDesc = reader.GetString(i, nIndex++, ""); config.nLocType = reader.GetInt(i, nIndex++, 0); String strSellID = reader.GetString(i, nIndex++, ""); string[] sellIDList = strSellID.Split(';'); if (sellIDList != null) { config.nSellIDList = new List <int>(); for (int j = 0; j < sellIDList.Length; ++j) { int nSellID = 0; if (Int32.TryParse(sellIDList[j], out nSellID)) { config.nSellIDList.Add(nSellID); } } } config.strPicName = reader.GetString(i, nIndex++, ""); m_adConfig.Add(config); } }
private void InitChatEmoticonConfigCsv(string strPath) { ScpReader reader = new ScpReader(strPath, true, 2); for (int i = 0; i < reader.GetRecordCount(); i++) { SSchemeChatEmoticonData sConfig = new SSchemeChatEmoticonData(); sConfig.nEmoticonID = reader.GetInt(i, (int)EChatEmoticonConfig.EEmoticon_ID, 0); sConfig.nEmoticonSerialID = reader.GetInt(i, (int)EChatEmoticonConfig.EEmoticon_Serial, 0); sConfig.eEmoticonType = (EMChatEmoticonType)Enum.Parse(typeof(EMChatEmoticonType), reader.GetString(i, (int)EChatEmoticonConfig.EEmoticon_Type, "")); sConfig.szEmoticonKey = reader.GetString(i, (int)EChatEmoticonConfig.EEmoticon_Key, string.Empty); sConfig.szCharInput = reader.GetString(i, (int)EChatEmoticonConfig.EEmoticon_CharInput, string.Empty); sConfig.szTipDesc = reader.GetString(i, (int)EChatEmoticonConfig.EEmoticon_TipDesc, string.Empty); sConfig.nEmoticonSellID = reader.GetInt(i, (int)EChatEmoticonConfig.EEmoticon_SellID, 0); sConfig.nEmoticonSkillID = reader.GetInt(i, (int)EChatEmoticonConfig.EEmoticon_skillID, 0); if (m_dicChatEmoticonConfig.ContainsKey(sConfig.nEmoticonID)) { Trace.LogWarning("有相同的聊天表情ID" + sConfig.nEmoticonID + "表第" + i + "行"); } else { m_dicChatEmoticonConfig.Add(sConfig.nEmoticonID, sConfig); } if (!m_chatEmoticonSerialList.ContainsKey(sConfig.nEmoticonSerialID)) { m_chatEmoticonSerialList.Add(sConfig.nEmoticonSerialID, new List <SSchemeChatEmoticonData>()); } m_chatEmoticonSerialList[sConfig.nEmoticonSerialID].Add(sConfig); } reader.Dispose(); reader = null; }
// 初始化csv表 protected void InitWarSupportPositionConfigCsv(string stPath) { ScpReader reader = new ScpReader(stPath, true, 2); allWarSupportPositionConfigTable = new Hashtable(); for (int i = 0; i < reader.GetRecordCount(); i++) { int nCol = 0; SSchemeWarSupportPositionConfig sConfig = new SSchemeWarSupportPositionConfig(); sConfig.nSortID = reader.GetInt(i, nCol++, 0); sConfig.nPlayerCount = reader.GetInt(i, nCol++, 0); sConfig.fUIPositionOffsetX = reader.GetFloat(i, nCol++, 0.0f); sConfig.playerOffsetVec3.x = reader.GetFloat(i, nCol++, 0.0f); sConfig.playerOffsetVec3.y = reader.GetFloat(i, nCol++, 0.0f); sConfig.playerOffsetVec3.z = reader.GetFloat(i, nCol++, 0.0f); if (allWarSupportPositionConfigTable.ContainsKey(sConfig.nSortID)) { (allWarSupportPositionConfigTable[sConfig.nSortID] as List <SSchemeWarSupportPositionConfig>).Add(sConfig); } else { List <SSchemeWarSupportPositionConfig> positionList = new List <SSchemeWarSupportPositionConfig>(); positionList.Add(sConfig); allWarSupportPositionConfigTable[sConfig.nSortID] = positionList; } } }
//加载快捷键信息 private void LoadKeyCodeNode(ScpReader reader, int row) { int nGroup = reader.GetInt(row, (int)Column_OBCtrl.COL_GROUP, 0); int nIndex = reader.GetInt(row, (int)Column_OBCtrl.COL_INDEX, 0); List <SchemeOBCtrlKeyCodeNode> nodeList; if (m_dicOBCtrlKeyCodeNodeMap.TryGetValue(nGroup, out nodeList)) { int tempIndex = nodeList.FindIndex(x => x.nIndex == nIndex); if (tempIndex > -1) { Trace.Log("scheme repeat! row = " + row + "file:" + schemeFileName); return; } } string szLabel = reader.GetString(row, (int)Column_OBCtrl.COL_LABEL, ""); string szKeyCode = reader.GetString(row, (int)Column_OBCtrl.COL_KEYCODE, ""); if (!m_dicOBCtrlKeyCodeNodeMap.ContainsKey(nGroup)) { m_dicOBCtrlKeyCodeNodeMap.Add(nGroup, new List <SchemeOBCtrlKeyCodeNode>()); } SchemeOBCtrlKeyCodeNode node = new SchemeOBCtrlKeyCodeNode(nGroup, nIndex, szLabel, szKeyCode); m_dicOBCtrlKeyCodeNodeMap[nGroup].Add(node); List <UnityEngine.KeyCode[]> keyCodeList = new List <UnityEngine.KeyCode[]>(); keyCodeList.AddRange(node.keyCodeList); m_dicOBCtrlKeyCodeMap.Add(nGroup * keyCodeEachTypeMax + nIndex, keyCodeList); }
// 载入奖励脚本 private void LoadActorPrizeConfig(string stPath) { ScpReader reader = new ScpReader(stPath, true, 2); for (int i = 0; i < reader.GetRecordCount(); i++) { int nIndex = 0; SSchemeActorPrizeConfig sConfig = new SSchemeActorPrizeConfig(); sConfig.nPrizeID = reader.GetInt(i, (int)nIndex++, 0); sConfig.strPrizeName = reader.GetString(i, (int)nIndex++, ""); sConfig.nPrizeIcon = reader.GetInt(i, (int)nIndex++, 0); sConfig.nPrizeGrade = reader.GetInt(i, (int)nIndex++, 0); sConfig.strPrizeDesc = reader.GetString(i, (int)nIndex++, ""); sConfig.nBroadcastFlag = reader.GetInt(i, (int)nIndex++, 0); sConfig.nPrizeType = reader.GetInt(i, (int)nIndex++, 0); sConfig.nCakeTrailEffectID = reader.GetInt(i, (int)nIndex++, 0); sConfig.nPedestalEffectID = reader.GetInt(i, (int)nIndex++, 0); sConfig.nPedestalGlowEffectID = reader.GetInt(i, (int)nIndex++, 0); sConfig.nPrizeParam = new int[5]; for (int j = 0; j < 5; ++j) { sConfig.nPrizeParam[j] = reader.GetInt(i, (int)nIndex++, 0); } m_actorPrizeConfig[sConfig.nPrizeID] = sConfig; } }
/// <summary> /// 创建当前玩家英雄后设置 /// </summary> /// <param name="_heroID">当前英雄ID</param> private void SetCurrentHeroRecommendGoods(CreateMainHeroEntityEventArgs e) { if (MobaRecommendGoodsReader == null) { return; } int SchemesHeroID = 0; for (int i = 0; i < MobaRecommendGoodsReader.GetRecordCount(); i++) { // 判断英雄ID SchemesHeroID = MobaRecommendGoodsReader.GetInt(i, (int)EMobaRecommendGoods.EMRG_HeroID, 0); if (SchemesHeroID == e.MainHeroID) { // 判断比赛类型 string strMatchType = MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_MatchTypes, ""); char[] charSeparator = new char[] { MobaSchemesConfig.separator }; List <int> intArray = ScpReader.ConvertStringToIntArray(strMatchType, charSeparator); if (!intArray.Contains((int)e.nMatchTypeID)) { continue; } // 获取装备配置 SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_EerlyList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_EerlyStage, "0")); SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_MiddleList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_MiddleStage, "0")); SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_DownWindList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_DownWindStage, "0")); SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_UpWindList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_UpWindStage, "0")); SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_ConsumeGoodsList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_ConsumeGoods, "0")); SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_DefaultGoodsTypeList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_DefaultTypes, "0")); SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_UsedStageList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_UsedStage, "0")); SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_DispositionStageList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_DispositionStage, "0")); CurrentHeroRecommendGoods.RecommendGoods_SummerID = MobaRecommendGoodsReader.GetInt(i, (int)EMobaRecommendGoods.EMRG_SummerID, 0); SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_SummerEerlyList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_SummerEerlyStage, "0")); SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_SummerMiddleList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_SummerMiddleStage, "0")); SetRecommendGoodsStage(CurrentHeroRecommendGoods.RecommendGoods_SummerDownWindList, MobaRecommendGoodsReader.GetString(i, (int)EMobaRecommendGoods.EMRG_SummerDownWindStage, "0")); } } MobaRecommendGoodsReader.Dispose(); MobaRecommendGoodsReader = null; EntityFactory.CreateMainHeroEntityEvent -= SetCurrentHeroRecommendGoods; if (MobaGoodsSchemesInitEndEvent != null) { MobaGoodsSchemesEventArgs a = new MobaGoodsSchemesEventArgs(); a.RecommendGoods = CurrentHeroRecommendGoods; a.LabelDescirptionTable = labelDescirptionTable; MobaGoodsSchemesInitEndEvent(a); } }
public void Load(string stPath) { ScpReader reader = new ScpReader(stPath, true, 2); configScheme = new Dictionary <int, SChatDefaultChannelScheme>(); for (int i = 0; i < reader.GetRecordCount(); i++) { SChatDefaultChannelScheme scheme = new SChatDefaultChannelScheme(); scheme.nMatchType = reader.GetInt(i, (int)EChatDefaultChannelCol.COL_MatchType, 0); scheme.nChannelInRoom = reader.GetInt(i, (int)EChatDefaultChannelCol.COL_ChannelInRoom, 0); configScheme[scheme.nMatchType] = scheme; } }
private void LoadKinLevelCsv(string stPath) { ScpReader reader = new ScpReader(stPath, true, 2); tKinLevelMap = new Dictionary <int, SSchemeKinLevel>(); for (int i = 0; i < reader.GetRecordCount(); i++) { SSchemeKinLevel kinLevel = new SSchemeKinLevel(); int level = reader.GetInt(i, (int)EKinLevelCol.KIN_LEVEL_COL_LEVEL, 0); kinLevel.nMaxPersonCount = reader.GetInt(i, (int)EKinLevelCol.KIN_LEVEL_COL_MAX_PERSON_COUNT, 0); tKinLevelMap[level] = kinLevel; } }
private void InitLifeHeroLightCsv(string stPath) { ScpReader reader = new ScpReader(stPath, true, 2); for (int i = 0; i < reader.GetRecordCount(); ++i) { SSchemeLifeHeroLight lifeHero = new SSchemeLifeHeroLight(); lifeHero.heroID = reader.GetInt(i, 0, -1); lifeHero.effectID = reader.GetInt(i, 1, -1); lifeHero.staticEffectID = reader.GetInt(i, 2, -1); lifeHeroLightDic[lifeHero.heroID] = lifeHero; } }
// 比赛限制脚本 private void LoadLegendCupLimitConfig(string stPath) { ScpReader reader = new ScpReader(stPath, true, 2); m_cupLimitConfig = new Dictionary <int, SSchemeLegendCupLimitConfig>(); for (int i = 0; i < reader.GetRecordCount(); i++) { SSchemeLegendCupLimitConfig limitInfo = new SSchemeLegendCupLimitConfig(); limitInfo.nConfigID = reader.GetInt(i, (int)ECupLimitCol.ECLC_COL_LIMIT_CONFIGID, 0); limitInfo.nCountLimit = reader.GetInt(i, (int)ECupLimitCol.ECLC_COL_LIMIT_COUNT, 0); m_cupLimitConfig.Add(limitInfo.nConfigID, limitInfo); } }
private void InitRecommendPrizeCsv(string stPath) { char[] charSeparator = new char[] { ';' }; ScpReader reader = new ScpReader(stPath, true, 2); for (int i = 0; i < reader.GetRecordCount(); ++i) { SSchemeRecommendPrize config = new SSchemeRecommendPrize(); config.targetID = reader.GetInt(i, (int)ECOLUMNType.TARGET_ID, 0); config.totalNumGames = reader.GetInt(i, (int)ECOLUMNType.TOTAL_NUMBER_OF_GAMES, 0); string szPrizes = reader.GetString(i, (int)ECOLUMNType.PRIZE_ID, ""); config.prizeList = ScpReader.ConvertStringToIntArray(szPrizes, charSeparator); m_listConfig.Add(config); } }
/// <summary> /// 初始化英雄信息配置 /// </summary> /// <param name="strDefaultViewConfigPath"></param> private void InitAboutDetailedPropertyInfo(string strDefaultViewConfigPath) { string strDetailedPropertyInfoPath = strDefaultViewConfigPath + MobaSchemesConfig.DETAILED_PROPERTY_INFO; ScpReader DetailedPropertyInfoReader = new ScpReader(strDetailedPropertyInfoPath, true, 2); DetailedPropertyInfoTable = new Hashtable(); int PropertyID = 0; for (int i = 0; i < DetailedPropertyInfoReader.GetRecordCount(); i++) { MobaDetatiledPropertyInfo PropertyInfo = new MobaDetatiledPropertyInfo(); PropertyID = DetailedPropertyInfoReader.GetInt(i, (int)EMobaDetailedPropertyInfo.EMDPIR_PropertyID, -1); if (PropertyID == -1) { continue; } PropertyInfo.PropertyName = DetailedPropertyInfoReader.GetString(i, (int)EMobaDetailedPropertyInfo.EMDPIR_PropertyName, ""); PropertyInfo.PropertyDes = DetailedPropertyInfoReader.GetString(i, (int)EMobaDetailedPropertyInfo.EMDPIR_PropertyDes, ""); UBB.toHtml(ref PropertyInfo.PropertyDes); DetailedPropertyInfoTable.Add(PropertyID, PropertyInfo); } }
public void Load(string strFilePath) { ScpReader reader = new ScpReader(strFilePath, true, 2); if (reader == null) { Trace.LogError("read scheme fail! file:" + strFilePath); return; } m_dicOBCtrlKeyCodeNodeMap.Clear(); m_dicOBCtrlParamNodeMap.Clear(); int nCount = reader.GetRecordCount(); for (int row = 0; row < nCount; row++) { int nType = reader.GetInt(row, (int)Column_OBCtrl.COL_TYPE, 0); if (nType == 1) { LoadKeyCodeNode(reader, row); } else if (nType == 2) { LoadParamNode(reader, row); } else { Trace.LogError("invalid type! row = " + row + "file:" + strFilePath); } } }
private void LoadDefaultConfig(string stPath) { //走mpk包暂不判断文件 //if (!File.Exists(stPath)) //{ // Trace.Error("配置表:ChatSettingConfig.csv 不存在!"); // return; //} ScpReader reader = new ScpReader(stPath, true, 2); for (int i = 0; i < reader.GetRecordCount(); i++) { int index = reader.GetInt(i, (int)ChatSettingTableColumn.Index, 0); string value = reader.GetString(i, (int)ChatSettingTableColumn.Value, ""); if (defaultChatSettingTable.ContainsKey((ChatSettingIndex)index)) { defaultChatSettingTable[(ChatSettingIndex)index] = value; } else { defaultChatSettingTable.Add((ChatSettingIndex)index, value); } } foreach (KeyValuePair <ChatSettingIndex, string> kvp in defaultChatSettingTable) { currentChatSettingTable.Add(kvp.Key, kvp.Value); } }
private void InitPreLoadSkinLayoutCsv(string stPath) { m_ConfigMap = new Dictionary <int, SPreLoadSkinLayout>(); ScpReader reader = new ScpReader(stPath, true, 2); for (int i = 0; i < reader.GetRecordCount(); i++) { SPreLoadSkinLayout config = new SPreLoadSkinLayout(); config.nSkinID = reader.GetInt(i, (int)PreLoadSkinLayoutColnum.EPSLC_SKIN_ID, 0); string strRelateSkinID = reader.GetString(i, (int)PreLoadSkinLayoutColnum.EPSLC_RELATE_SKIN_ID, ""); string[] relateSkinIDArray = strRelateSkinID.Split(';'); config.nRelateSkinID = new int[relateSkinIDArray.Length]; for (int j = 0; j < relateSkinIDArray.Length; ++j) { if (relateSkinIDArray[j] == "") { continue; } if (!int.TryParse(relateSkinIDArray[j], out config.nRelateSkinID[j])) { Debug.LogError(String.Format("配置格式错误:皮肤id格式错误,relateskinid={0},{1}", relateSkinIDArray[j], stPath)); continue; } } m_ConfigMap.Add(config.nSkinID, config); } }
public void Load(string strFilePath) { ScpReader reader = new ScpReader(strFilePath, true, 2); if (reader == null) { Trace.LogError("read sheme fail! file=" + strFilePath); return; } m_dicHeroSoundNodeMap.Clear(); int nRecordCount = reader.GetRecordCount(); for (int row = 0; row < nRecordCount; row++) { int nHeroID = reader.GetInt(row, 0, 0); if (m_dicHeroSoundNodeMap.ContainsKey(nHeroID)) { Trace.LogWarning("scheme id repeat! " + schemeFileName + " row=" + row); continue; } string randomArry = reader.GetString(row, 1, ""); SchemeHeroSoundNode node = new SchemeHeroSoundNode(nHeroID); node.PushSoundData(randomArry); m_dicHeroSoundNodeMap.Add(nHeroID, node); } }
public void Load(string strFilePath) { ScpReader reader = new ScpReader(strFilePath, true); if (reader == null) { Trace.LogError("read scheme fail! file = " + strFilePath); return; } m_dicLightEffectNodeList.Clear(); if (AssetBundleManager.isOnRunTimeMode) { int nRecorderCount = reader.GetRecordCount(); for (int row = 0; row < nRecorderCount; row++) { int nType = reader.GetInt(row, (int)Column_Common.COL_CFGTYPE, 0); AddSchemeNode(nType, reader, row); } } else { UnityEngine.Object[] assets = AssetBundleManager.LoadAllAssetOnEditorFromPathInstance(editorModeAssetPath, typeof(LightingEffect)); foreach (UnityEngine.Object asset in assets) { LightingEffect ef = asset as LightingEffect; AddLightEffect(ef); } } }
// 初始化csv表 protected void InitMatchRoomOpenAILevelConfigCsv(string stPath) { // string stSchemeAllText = File.ReadAllText(stPath); ScpReader reader = new ScpReader(stPath, true, 2); for (int i = 0; i < reader.GetRecordCount(); i++) { SSchemeMatchRoomOpenAILevel sConfig = new SSchemeMatchRoomOpenAILevel(); sConfig.nMatchTypeID = reader.GetInt(i, (int)EMatchRoomOpenAILevel.ERC_MATCHTYPE_ID, 0); sConfig.AILevelDes = reader.GetString(i, (int)EMatchRoomOpenAILevel.ERC_AILEVEL_DES, ""); sConfig.AILevelScore = reader.GetString(i, (int)EMatchRoomOpenAILevel.ERC_AILEVEL_SCORE, ""); // 配置检查 string[] AILevelDesStr = sConfig.AILevelDes.Split(';'); int nDescLength = AILevelDesStr.Length; string[] AIScoreArrayStr = sConfig.AILevelScore.Split(';'); int nScoreLength = AIScoreArrayStr.Length; if (nDescLength != nScoreLength) { Trace.LogError("配置出错 请检查 MatchRoomOpenAILevel.csv 位置:=(" + (i + 1) + ")行"); } if (allOpenAILevelTable.ContainsKey(sConfig.nMatchTypeID)) { Trace.LogError("重复id 检查配置MatchRoomOpenAILevel.csv!id =" + sConfig.nMatchTypeID); } allOpenAILevelTable.Add(sConfig.nMatchTypeID, sConfig); } }
public void Load(string strFilePath) { ScpReader reader = new ScpReader(strFilePath, true, 2); if (reader == null) { Trace.LogError("read sheme fail! file=" + strFilePath); return; } m_dicSocialSharingNodeList.Clear(); int nRecordCount = reader.GetRecordCount(); for (int row = 0; row < nRecordCount; row++) { int nType = reader.GetInt(row, (int)Column.COL_SHARINGTYPE, 0); if (nType < 0 || nType >= (int)SocialSharingType.TypeMax) { Trace.LogWarning("scheme sharingType invalid! file=" + strFilePath); continue; } string title = reader.GetString(row, (int)Column.COL_TITLE, ""); string desc = reader.GetString(row, (int)Column.COL_DESC, ""); AddNode((SocialSharingType)nType, title, desc); } }