资源简介
我在一篇博客里介绍该源码的生成流程,大家可以访问去学习
代码片段和文件信息
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using LitJson;
public class CreateGoodJson
{
[MenuItem(“CreateJson/GoodJson“)]
public static void CreateJson()
{
List list = new List();
baseProperty baseProperty_Ring = new baseProperty(1 “Ring“ “传说\n梅戒 攻击 +10 防御 +100\n\nwww.liujunliang.com.cn by 即歩“ 10 100 80 “UI/Good (1)“ KnapsackGood.GoodType.Consumable KnapsackGood.GoodQuality.Common);
Consumable good_Ring = new Consumable(10 10 baseProperty_Ring);
baseProperty baseProperty_Hat = new baseProperty(2 “Hat“ “绝世\n无视宝帽 攻击 +200 防御 +70\n\nwww.liujunliang.com.cn by 即歩“ 10 100 100 “UI/Good (17)“ KnapsackGood.GoodType.Equipment KnapsackGood.GoodQuality.Epic);
Equipment good_Hat = new Equipment(100 50 30 50 Equipment.EquitmentType.Head baseProperty_Hat);
baseProperty baseProperty_Wing = new baseProperty(3 “Wing“ “天下无双\n天使的翅膀 攻击 +10 速度 +100\n\nwww.liujunliang.com.cn by 即歩“ 10 100 100 “UI/Good (2)“ KnapsackGood.GoodType.Equipment KnapsackGood.GoodQuality.Legendary);
Equipment good_Wing = new Equipment(100 50 30 50 Equipment.EquitmentType.Neck baseProperty_Wing);
baseProperty baseProperty_Cloth = new baseProperty(4 “Cloth“ “稀有\n占灵宝甲 攻击 -10 防御 +200\n\nwww.liujunliang.com.cn by 即歩“ 10 100 100 “UI/Good (3)“ KnapsackGood.GoodType.Equipment KnapsackGood.GoodQuality.Rare);
Equipment good_Cloth = new Equipment(100 50 30 50 Equipment.EquitmentType.Shoulder baseProperty_Cloth);
baseProperty baseProperty_Shoes = new baseProperty(5 “Shoes“ “稀有\n急速战靴 攻击 -10 防御 +200\n\nwww.liujunliang.com.cn by 即歩“ 10 100 100 “UI/Good (8)“ KnapsackGood.GoodType.Equipment KnapsackGood.GoodQuality.Rare);
Equipment good_Shoes = new Equipment(100 50 30 50 Equipment.EquitmentType.Leg baseProperty_Shoes);
baseProperty baseProperty_Sword = new baseProperty(6 “Sword“ “绝世\n独孤九剑 攻击 +200 防御 +70\n\nwww.liujunliang.com.cn by 即歩“ 10 100 100 “UI/Good (21)“ KnapsackGood.GoodType.Weapon KnapsackGood.GoodQuality.Uncommon);
Weapon good_Sword = new Weapon(100 Weapon.WeaponType.MainHand baseProperty_Sword);
baseProperty baseProperty_Axe = new baseProperty(7“Axe“ “绝世\n巨凌战斧 攻击 +100 防御 +50\n\nwww.liujunliang.com.cn by 即歩“10100100 “UI/Good (6)“KnapsackGood.GoodType.WeaponKnapsackGood.GoodQuality.Uncommon);
Weapon good_Axe = new Weapon(50 Weapon.WeaponType.OffHand baseProperty_Axe);
list.Add(good_Ring);
list.Add(good_Hat);
list.Add(good_Wing);
list.Add(good_Cloth);
list.Add(good_Shoes);
list.Add(good_Sword);
list.Add(good_Axe);
//生成Json
string json = JsonMapper.ToJson(list);
string path = Application.streamingAssetsPath + “/GoodJson.json“;
#region 文件流方式写入文件
/*将json内容打包进文件,最好不要转化编码
//将Json信息保存进文件
using
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-04-19 20:29 KnapsackSystem\
目录 0 2017-04-10 16:20 KnapsackSystem\.vs\
目录 0 2017-04-10 16:20 KnapsackSystem\.vs\KnapsackSystem\
目录 0 2017-04-15 15:40 KnapsackSystem\.vs\KnapsackSystem\v15\
文件 107008 2017-04-16 21:31 KnapsackSystem\.vs\KnapsackSystem\v15\.suo
文件 6894 2017-04-19 19:39 KnapsackSystem\Assembly-CSharp-Editor.csproj
文件 5438 2017-04-19 19:39 KnapsackSystem\Assembly-CSharp.csproj
目录 0 2017-04-13 20:37 KnapsackSystem\Assets\
目录 0 2017-04-16 15:10 KnapsackSystem\Assets\Editor\
文件 192 2017-04-13 14:47 KnapsackSystem\Assets\Editor.me
文件 3741 2017-04-18 18:50 KnapsackSystem\Assets\Editor\CreateGoodJson.cs
文件 263 2017-04-13 14:48 KnapsackSystem\Assets\Editor\CreateGoodJson.cs.me
目录 0 2017-04-10 17:00 KnapsackSystem\Assets\Plugins\
文件 191 2017-04-10 12:43 KnapsackSystem\Assets\Plugins.me
文件 52736 2013-04-26 17:36 KnapsackSystem\Assets\Plugins\LitJson.dll
文件 393 2017-04-10 17:00 KnapsackSystem\Assets\Plugins\LitJson.dll.me
目录 0 2017-04-18 22:23 KnapsackSystem\Assets\Prefabs\
文件 192 2017-04-11 15:40 KnapsackSystem\Assets\Prefabs.me
文件 20676 2017-04-18 18:28 KnapsackSystem\Assets\Prefabs\BoxPanel.prefab
文件 179 2017-04-17 21:38 KnapsackSystem\Assets\Prefabs\BoxPanel.prefab.me
文件 21028 2017-04-18 22:23 KnapsackSystem\Assets\Prefabs\CharatorPanel.prefab
文件 179 2017-04-18 17:52 KnapsackSystem\Assets\Prefabs\CharatorPanel.prefab.me
文件 8092 2017-04-18 19:25 KnapsackSystem\Assets\Prefabs\Charatorslot.prefab
文件 179 2017-04-18 19:23 KnapsackSystem\Assets\Prefabs\Charatorslot.prefab.me
文件 11340 2017-04-15 16:22 KnapsackSystem\Assets\Prefabs\goodUI.prefab
文件 180 2017-04-11 16:17 KnapsackSystem\Assets\Prefabs\goodUI.prefab.me
文件 25100 2017-04-15 19:40 KnapsackSystem\Assets\Prefabs\KnapsackPanel.prefab
文件 180 2017-04-11 16:18 KnapsackSystem\Assets\Prefabs\KnapsackPanel.prefab.me
文件 8012 2017-04-13 20:51 KnapsackSystem\Assets\Prefabs\slot.prefab
文件 180 2017-04-13 20:24 KnapsackSystem\Assets\Prefabs\slot.prefab.me
文件 13700 2017-04-15 19:54 KnapsackSystem\Assets\Prefabs\ToolTilePanel.prefab
............此处省略599个文件信息
- 上一篇:CT图像-肺结节检测
- 下一篇:机器人运动学及动力学
评论
共有 条评论