// 重置探索数据 public void ResetExploreData() { mMapEventsRecords.Clear(); mCurrentMapEventsRecord = null; mCurrentMapWordRecords.Clear(); mCurrentMapMiniMapRecord = null; mChatRecords.Clear(); }
/// <summary> /// 重置小地图记录 /// </summary> public void ResetMiniMapEventsRecord() { bool hasRecord = DataHandler.FileExist(CommonData.miniMapRecordFilePath); if (hasRecord) { DataHandler.DeleteFile(CommonData.miniMapRecordFilePath); } MiniMapRecord currentMinimapRecord = null; GameManager.Instance.gameDataCenter.currentMapMiniMapRecord = null; DataHandler.SaveInstanceDataToFile <MiniMapRecord>(currentMinimapRecord, CommonData.miniMapRecordFilePath); }
/// <summary> /// 根据数据名称释放数据资源 /// </summary> /// <param name="type">Type.</param> private void ReleaseDataWithName(GameDataType type) { switch (type) { case GameDataType.GameSettings: mGameSettings = null; break; case GameDataType.GameLevelDatas: mGameLevelDatas.Clear(); break; case GameDataType.EquipmentModels: mAllEquipmentModels.Clear(); break; case GameDataType.ConsumablesModels: mAllConsumablesModels.Clear(); break; case GameDataType.SkillGemstoneModels: mAllPropertyGemstoneModels.Clear(); break; case GameDataType.SpecialItemModels: mAllSpecialItemModels.Clear(); break; case GameDataType.SpellItemModels: mAllSpellItemModels.Clear(); break; case GameDataType.SkillScrollModels: mAllSkillScrollModels.Clear(); break; case GameDataType.EquipmentSprites: mAllEquipmentSprites.Clear(); MyResourceManager.Instance.UnloadAssetBundle(CommonData.allEquipmentSpritesBundleName, true); break; case GameDataType.ConsumablesSprites: mAllConsumablesSprites.Clear(); MyResourceManager.Instance.UnloadAssetBundle(CommonData.allConsumablesSpritesBundleName, true); break; case GameDataType.SkillGemstoneSprites: mAllPropertyGemstoneSprites.Clear(); MyResourceManager.Instance.UnloadAssetBundle(CommonData.allPropertyGemstoneSpritesBundleName, true); break; case GameDataType.SpecialItemSprites: mAllSpecialItemSprites.Clear(); MyResourceManager.Instance.UnloadAssetBundle(CommonData.allSpecialItemSpritesBundleName, true); break; case GameDataType.SkillScrollSprites: mAllSkillScrollSprites.Clear(); MyResourceManager.Instance.UnloadAssetBundle(CommonData.allSkillScrollSpritesBundleName, true); break; case GameDataType.MapSprites: mAllMapSprites.Clear(); MyResourceManager.Instance.UnloadAssetBundle(CommonData.allMapSpritesBundleName, true); break; case GameDataType.MapTileAtlas: MyResourceManager.Instance.UnloadAssetBundle(CommonData.mapTileset_1_BundleName, true); MyResourceManager.Instance.UnloadAssetBundle(CommonData.mapTileset_2_BundleName, true); MyResourceManager.Instance.UnloadAssetBundle(CommonData.mapTileset_3_BundleName, true); MyResourceManager.Instance.UnloadAssetBundle(CommonData.mapTileset_4_BundleName, true); MyResourceManager.Instance.UnloadAssetBundle(CommonData.mapTileset_5_BundleName, true); break; case GameDataType.CharacterSprites: mAllCharacterSprites.Clear(); MyResourceManager.Instance.UnloadAssetBundle(CommonData.allCharacterSpritesBundleName, true); break; case GameDataType.Skills: mAllSkills.Clear(); TransformManager.DestroyTransfromWithName("AllSkills"); MyResourceManager.Instance.UnloadAssetBundle(CommonData.allSkillsBundleName, true); break; case GameDataType.SkillSprites: mAllSkillSprites.Clear(); MyResourceManager.Instance.UnloadAssetBundle(CommonData.allSkillSpritesBundleName, true); break; case GameDataType.MiniMapSprites: mAllMinimapSprites.Clear(); MyResourceManager.Instance.UnloadAssetBundle(CommonData.allMinimapSpritesBundleName, true); break; case GameDataType.Monsters: MyResourceManager.Instance.UnloadAssetBundle(CommonData.allMonstersBundleName, true); break; case GameDataType.MonstersUI: MyResourceManager.Instance.UnloadAssetBundle(CommonData.allMonstersUIBundleName, true); break; case GameDataType.MonstersData: mAllMonstersData.Clear(); break; case GameDataType.NPCs: MyResourceManager.Instance.UnloadAssetBundle(CommonData.allMapNpcBundleName, true); break; case GameDataType.Effects: mAllEffects.Clear(); TransformManager.DestroyTransfromWithName("AllEffects"); MyResourceManager.Instance.UnloadAssetBundle(CommonData.allEffectsBundleName, true); break; case GameDataType.Diary: mAllDiaryModels.Clear(); break; case GameDataType.Proverbs: mAllProverbs.Clear(); break; case GameDataType.Puzzle: mAllPuzzles.Clear(); break; case GameDataType.PlayRecord: mAllPlayRecords.Clear(); break; case GameDataType.ChatRecord: mChatRecords.Clear(); break; case GameDataType.CurrentMapMiniMapRecord: mCurrentMapMiniMapRecord = null; break; case GameDataType.MapEventsRecords: mMapEventsRecords.Clear(); break; case GameDataType.CurrentMapEventsRecord: mCurrentMapEventsRecord = null; break; case GameDataType.CurrentMapWordsRecord: mCurrentMapWordRecords.Clear(); break; case GameDataType.BagCanvas: GameManager.Instance.UIManager.RemoveCanvasCache("BagCanvas"); break; case GameDataType.SettingCanvas: GameManager.Instance.UIManager.RemoveCanvasCache("SettingCanvas"); break; case GameDataType.ShareCanvas: GameManager.Instance.UIManager.RemoveCanvasCache("ShareCanvas"); break; case GameDataType.NPCCanvas: GameManager.Instance.UIManager.RemoveCanvasCache("NPCCanvas"); break; case GameDataType.LoadingCanvas: GameManager.Instance.UIManager.RemoveCanvasCache("LoadingCanvas"); break; case GameDataType.GuideCanvas: GameManager.Instance.UIManager.RemoveCanvasCache("GuideCanvas"); break; case GameDataType.RecordCanvas: GameManager.Instance.UIManager.RemoveCanvasCache("RecordCanvas"); break; case GameDataType.HomeCanvas: GameManager.Instance.UIManager.RemoveCanvasCache("HomeCanvas"); break; case GameDataType.ExploreScene: GameManager.Instance.UIManager.RemoveCanvasCache("ExploreCanvas"); MyResourceManager.Instance.UnloadAssetBundle(CommonData.exploreSceneBundleName, true); break; case GameDataType.PlayRecordCanvas: GameManager.Instance.UIManager.RemoveCanvasCache("PlayRecordCanvas"); break; case GameDataType.UpdateDataCanvas: GameManager.Instance.UIManager.RemoveCanvasCache("UpdateDataCanvas"); break; } }