[战斗]=======主角变身卡添加gm

dev_chengFeng
wangzhenxing 2021-11-25 18:36:00 +08:00
parent a8f666e901
commit 6927b52365
3 changed files with 522 additions and 581 deletions

View File

@ -348,6 +348,11 @@ function this.RefreshFightData(type)
local MSkillId = data.id..data.star
data.skill={}
data.skill[1] = BattleManager.MonsterSkillAdapter(MSkillId) or {}
if monster.skillId~=nil and monster.skillId~=0 then
LogError("data.skill=="..monster.skillId)
--data.position=100
data.skill[1] = BattleManager.PlayerSkillAdapter(monster.skillId) or {}
end
-- 添加角色数据
this.AddMonsterData(data)
end

View File

@ -24,6 +24,7 @@ function MonsterSetView:Init(root)
self.monsterTip = Util.GetGameObject(root, "monster"):GetComponent("Text")
self.mId = Util.GetGameObject(root, "monster/id"):GetComponent("InputField")
self.star = Util.GetGameObject(root, "monster/star"):GetComponent("InputField")
self.skill = Util.GetGameObject(root, "monster/skill"):GetComponent("InputField")
self.props = Util.GetGameObject(root, "monster/props")
self.propList = {}
for i = 1, self.props.transform.childCount do
@ -75,11 +76,18 @@ function MonsterSetView:ApplyData()
end
self.curData.id = tonumber(self.mId.text)
self.curData.star = tonumber(self.star.text)
self.curData.skillId=tonumber(self.skill.text)
LogError("id=="..self.skill.text)
for propIndex, prop in ipairs(self.propList) do
local value = prop.text == "" and 0 or prop.text
self.curData.props[propIndex] = tonumber(value)
end
self.data[self.camp * 6 + self.curChoose] = self.curData
if self.curData.skillId~=nil and self.curData.skillId~=0 then
self.data[self.camp * 6 + self.curChoose] = self.curData
else
self.data[self.camp * 6 + self.curChoose] = self.curData
end
self:saveToLocal()
-- 应用数据