/// <summary> /// 初始化枪械的数组 /// </summary> private void InitGunData() { gunData = new List <GunWeaponData>(); gunData = JsonLoadTool.LoadJsonWithPath <GunWeaponData>("Json/GunWeaponData"); //gunData = JsonLoadTool.LoadJsonWithPathUseIO<GunWeaponData>("GunWeaponData.txt"); }
/// <summary> /// 传递一个字符串,来读取其中的Json数据 /// </summary> /// <param name="path">txt 文本的名称</param> /// <returns>返回一个 List<Inventory> </returns> public List <InventoryItem> GetItemList(string fileName) { //return JsonLoadTool.LoadJsonWithPath<InventoryItem>("Json/" + path); return(JsonLoadTool.LoadJsonWithPathUseIO <InventoryItem>(fileName)); }