public static CampPatrolData GetCampData(int id) { for (int i = 0; i < m_MapCampList.Count; i++) { CampPatrolData cpData = m_MapCampList[i]; if (cpData.mId == id) { return(cpData); } } return(null); }
public static void LoadAllData() { if (s_localDatabase != null) { return; } #if UNITY_EDITOR System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); sw.Start(); #endif s_localDatabase = LoadDb(); SkillSystem.SkData.LoadData(); Pathea.Effect.EffectData.LoadData(); Pathea.Projectile.ProjectileData.LoadData(); Pathea.RequestRelation.LoadData(); Pathea.CampData.LoadData(); Pathea.ThreatData.LoadData(); Pathea.DamageData.LoadData(); HumanSoundData.LoadData(); ItemDropData.LoadData(); PELocalization.LoadData(); NaturalResAsset.NaturalRes.LoadData(); //SkillAsset.EffCastData.LoadData(); //SkillAsset.EffSkill.LoadData(); //SkillAsset.MergeSkill.LoadData(); //AnimData.LoadData(); //AnimSoundData.LoadData(); AiAsset.AiData.LoadData(); SoundAsset.SESoundBuff.LoadData(); SoundAsset.SESoundStory.LoadData(); //CharacterData.LoadCharacterData(); StoryDoodadMap.LoadData(); StoreRepository.LoadData(); NpcMissionDataRepository.LoadData(); //PlayerAttribute.LoadData(); MissionRepository.LoadData(); TalkRespository.LoadData(); //NpcRandomRepository.LoadData(); ShopRespository.LoadData(); WareHouseManager.LoadData(); //HeroTalkRepository.LoadData(); MutiPlayRandRespository.LoadData(); PromptRepository.LoadData(); //MapIconData.LoadDate(); //MapMaskData.LoadDate(); CampPatrolData.LoadDate(); Camp.LoadData(); RepProcessor.LoadData(); CloudManager.LoadData(); //BattleUnitData.LoadData(); TutorialData.LoadData(); //RepairMachineManager.LoadData(); MapMaskData.LoadDate(); MessageData.LoadData(); //lz-2016.07.13 Add it MonsterHandbookData.LoadData(); //lz-2016.07.20 Add it StoryRepository.LoadData(); RMRepository.LoadRandMission(); MisInitRepository.LoadData(); CameraRepository.LoadCameraPlot(); AdRMRepository.LoadData(); VCConfig.InitConfig(); Cutscene.LoadData(); // BuildBrushData.LoadBrush(); BSPattern.LoadBrush(); BSVoxelMatMap.Load(); BSBlockMatMap.Load(); BlockBuilding.LoadBuilding(); LifeFormRule.LoadData(); PlantInfo.LoadData(); MetalScanData.LoadData(); BattleConstData.LoadData(); CustomCharactor.CustomMetaData.LoadData(); SkillTreeInfo.LoadData(); VArtifactUtil.LoadData(); Pathea.ActionRelationData.LoadActionRelation(); //colony CSInfoMgr.LoadData(); ProcessingObjInfo.LoadData(); CSTradeInfoData.LoadData(); CampTradeIdData.LoadData(); AbnormalTypeTreatData.LoadData(); CSMedicineSupport.LoadData(); //RandomItemMgr RandomItemDataMgr.LoadData(); FecesData.LoadData(); //randomdungeon RandomDungeonDataBase.LoadData(); AbnormalData.LoadData(); PEAbnormalNoticeData.LoadData(); RelationInfo.LoadData(); EquipSetData.LoadData(); SuitSetData.LoadData(); CheatData.LoadData(); Pathea.NpcProtoDb.Load(); Pathea.MonsterProtoDb.Load(); Pathea.MonsterRandomDb.Load(); Pathea.MonsterGroupProtoDb.Load(); Pathea.RandomNpcDb.Load(); Pathea.PlayerProtoDb.Load(); Pathea.TowerProtoDb.Load(); Pathea.DoodadProtoDb.Load(); Pathea.AttPlusNPCData.Load(); Pathea.AttPlusBuffDb.Load(); Pathea.NpcTypeDb.Load(); Pathea.NpcRandomTalkDb.Load(); Pathea.NpcThinkDb.LoadData(); Pathea.NpcEatDb.LoadData(); Pathea.NpcRobotDb.Load(); Pathea.NPCScheduleData.Load(); Pathea.NpcVoiceDb.LoadData(); InGameAidData.LoadData(); //lz-2016.08.21 add it MountsSkillDb.LoadData(); #if UNITY_EDITOR sw.Stop(); Debug.Log("Database Loaded : " + sw.ElapsedMilliseconds); sw.Reset(); #else Debug.Log("Database Loaded"); #endif }
public static void LoadDate() { m_MapCampList = new List <CampPatrolData>(); SqliteDataReader reader = LocalDatabase.Instance.ReadFullTable("CampPatrol"); while (reader.Read()) { CampPatrolData fMaskData = new CampPatrolData(); fMaskData.mId = Convert.ToInt32(reader.GetString(0)); fMaskData.mDescription = reader.GetString(1); string[] posStr = reader.GetString(2).Split(','); fMaskData.mPosition = new Vector3(Convert.ToSingle(posStr[0]), Convert.ToSingle(posStr[1]), Convert.ToSingle(posStr[2])); fMaskData.mRadius = Convert.ToSingle(reader.GetString(3)); string strTmp = reader.GetString(4); string[] tmpList = strTmp.Split(';'); for (int i = 0; i < tmpList.Length; i++) { posStr = tmpList[i].Split(','); if (posStr.Length != 3) { continue; } fMaskData.mPatrolList.Add(new Vector3(Convert.ToSingle(posStr[0]), Convert.ToSingle(posStr[1]), Convert.ToSingle(posStr[2]))); } strTmp = reader.GetString(5); tmpList = strTmp.Split(','); for (int i = 0; i < tmpList.Length; i++) { if (tmpList[i] == "0") { continue; } fMaskData.mPatrolNpc.Add(tmpList[i]); } fMaskData.mPatrolNum = Convert.ToInt32(reader.GetString(6)); //strTmp = reader.GetString(7); //tmpList = strTmp.Split(','); //for (int i = 0; i < tmpList.Length; i++) //{ // if (tmpList[i] == "0") // continue; // fMaskData.mEquipIDList.Add(Convert.ToInt32(tmpList[i])); //} strTmp = reader.GetString(8); tmpList = strTmp.Split('_'); if (tmpList.Length == 2) { fMaskData.mPatrolTimeMin = Convert.ToInt32(tmpList[0]) * 3600; fMaskData.mPatrolTimeMax = Convert.ToInt32(tmpList[1]) * 3600; } strTmp = reader.GetString(9); tmpList = strTmp.Split('_'); if (tmpList.Length == 2) { fMaskData.mSleepTime = Convert.ToInt32(tmpList[0]); fMaskData.mWakeupTime = Convert.ToInt32(tmpList[1]); } strTmp = reader.GetString(10); tmpList = strTmp.Split(','); string[] tmpList1; for (int i = 0; i < tmpList.Length; i++) { if (tmpList[i] == "0") { continue; } tmpList1 = tmpList[i].Split('_'); if (tmpList1.Length != 2) { continue; } fMaskData.mTalkTimeMin.Add(Convert.ToSingle(tmpList1[0])); fMaskData.mTalkTimeMax.Add(Convert.ToSingle(tmpList1[1])); } strTmp = reader.GetString(11); tmpList = strTmp.Split(','); for (int i = 0; i < tmpList.Length; i++) { if (tmpList[i] == "0") { continue; } tmpList1 = tmpList[i].Split('_'); if (tmpList1.Length != 2) { continue; } fMaskData.mEatTimeMin.Add(Convert.ToSingle(tmpList1[0])); fMaskData.mEatTimeMax.Add(Convert.ToSingle(tmpList1[1])); } string[] tmpList2; int tmpid; //id,id_talkid,talkid;id,id_talkid,talkid strTmp = reader.GetString(12); tmpList = strTmp.Split(';'); for (int i = 0; i < tmpList.Length; i++) { if (tmpList[i] == "0") { continue; } tmpList1 = tmpList[i].Split('_'); if (tmpList1.Length != 2) { continue; } tmpList2 = tmpList1[0].Split(','); for (int j = 0; j < tmpList2.Length; j++) { fMaskData.m_PreLimit.Add(Convert.ToInt32(tmpList2[j])); } tmpList2 = tmpList1[1].Split(','); for (int j = 0; j < tmpList2.Length; j++) { tmpid = Convert.ToInt32(tmpList2[j]); fMaskData.m_TalkList.Add(tmpid); } } m_MapCampList.Add(fMaskData); } }