Unity3D自学笔记——UGUI背包系统(一)ItemData

ItemData 创建数据模型

效果图

这里写图片描述

模型说明

这里写图片描述
ID:不是自增列,约束命名规则方便排序及长着,ID命名规则为,ItemType + HeroType + Index,如300001,代表武器 + 所有角色都能使用 + 001号
这里写图片描述
Price:购买价格,售价就是购买价格乘以固定比例
IconPath: Resouces图片文件目录相对路径
ItemType: 类型,对应枚举变量
0: Other 10:Potion 20:Stuff 30:Weapon 31:Armor 32:Ring
33:Necklace
跳号进行编写枚举是为了方便扩展
HeroType: 哪些英雄可以使用
CanLvUp: 是否可以升级
Lv:基础等级
Max:最大等级
Hp:基础属性,该Item给持有角色带来的额外附加属性
HpGrowth:每升一级增加属性
StackCount:在背包里最大堆叠数量

数据库

这里写图片描述

CREATE TABLE `iteminfo` (
  `Id` int(11) NOT NULL DEFAULT '0' COMMENT 'ItemType + HeroTyp + Index',
  `name` varchar(255) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `itemType` int(11) DEFAULT '0' COMMENT '0: Other 10:Potion 20:Stuff 30:Weapon 31:Armor 32:Ring 33:Necklace',
  `price` int(11) DEFAULT '0',
  `iconPath` varchar(255) DEFAULT NULL,
  `heroType` int(11) DEFAULT '0' COMMENT '0: All, 1: hero1, 2: hero2',
  `lv` int(11) DEFAULT '1',
  `maxLv` int(11) DEFAULT '1',
  `hp` int(11) DEFAULT '0',
  `mp` int(11) DEFAULT '0',
  `atk` int(11) DEFAULT '0',
  `def` int(11) DEFAULT '0',
  `spd` int(11) DEFAULT '0',
  `hit` int(11) DEFAULT '0',
  `criticalRate` double(5,2) DEFAULT '0.00',
  `atkSpd` double(5,2) DEFAULT '0.00',
  `atkRange` double(5,2) DEFAULT '0.00',
  `MoveSpd` double(5,2) DEFAULT '0.00',
  `hp_growth` int(11) DEFAULT '0',
  `mp_growth` int(11) DEFAULT '0',
  `atk_growth` int(11) DEFAULT '0',
  `def_growth` int(11) DEFAULT '0',
  `spd_growth` int(11) DEFAULT '0',
  `hit_g
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值