2021-01-09 14:20:06 +08:00
|
|
|
|
|
2020-11-01 15:46:48 +08:00
|
|
|
|
-- 全局设置界面
|
|
|
|
|
SkillSetView = {}
|
|
|
|
|
|
|
|
|
|
local MonsterViewConfig = ConfigManager.GetConfig(ConfigName.MonsterViewConfig)
|
|
|
|
|
local MonsterConfig = ConfigManager.GetConfig(ConfigName.MonsterConfig)
|
|
|
|
|
local RoleConfig = ConfigManager.GetConfig(ConfigName.RoleConfig)
|
|
|
|
|
local HeroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig)
|
|
|
|
|
local SkillLogicConfig = ConfigManager.GetConfig(ConfigName.SkillLogicConfig)
|
|
|
|
|
|
|
|
|
|
-- 初始化角色设置界面
|
|
|
|
|
function SkillSetView:Init(root)
|
|
|
|
|
self.gameObject = root
|
|
|
|
|
self.rt = Util.GetGameObject(root, "role/time1/input"):GetComponent("InputField")
|
|
|
|
|
self.rt2 = Util.GetGameObject(root, "role/time2/input"):GetComponent("InputField")
|
|
|
|
|
self.nt1 = Util.GetGameObject(root, "normal/time1/input"):GetComponent("InputField")
|
|
|
|
|
self.nt2 = Util.GetGameObject(root, "normal/time2/input"):GetComponent("InputField")
|
|
|
|
|
self.st1 = Util.GetGameObject(root, "special/time1/input"):GetComponent("InputField")
|
|
|
|
|
self.st2 = Util.GetGameObject(root, "special/time2/input"):GetComponent("InputField")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.btnComfirm = Util.GetGameObject(root, "Root/confirm")
|
|
|
|
|
self.btnCancel = Util.GetGameObject(root, "Root/cancel")
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
Util.AddOnceClick(self.btnComfirm, function()
|
|
|
|
|
self:ApplyData()
|
|
|
|
|
end)
|
|
|
|
|
--
|
|
|
|
|
Util.AddOnceClick(self.btnCancel, function()
|
|
|
|
|
self:Close()
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function SkillSetView:Show(camp, pos, BattleView)
|
|
|
|
|
self.gameObject:SetActive(true)
|
|
|
|
|
self.camp = camp
|
|
|
|
|
self.pos = pos
|
|
|
|
|
self.role = RoleManager.GetRole(camp, pos)
|
|
|
|
|
self.roleView = BattleView.GetRoleView(self.role)
|
|
|
|
|
|
|
|
|
|
local nSkillId = self.role.roleData.skill[1]
|
|
|
|
|
local sSkillId = self.role.roleData.superSkill[1]
|
|
|
|
|
|
|
|
|
|
self.rt.text = self.roleView.spAtkTime*1000
|
|
|
|
|
self.rt2.text = self.roleView.atkSoundTime*1000
|
|
|
|
|
|
2020-11-06 20:45:21 +08:00
|
|
|
|
local nCId = BattleManager.GetCombatIdBySkin(nSkillId, 0)
|
|
|
|
|
local nCombat = BattleManager.GetSkillCombat(nCId)
|
2020-11-01 15:46:48 +08:00
|
|
|
|
self.nt1.text = nCombat.BulletTime
|
|
|
|
|
self.nt2.text = nCombat.KeyFrame
|
|
|
|
|
|
2020-11-06 20:45:21 +08:00
|
|
|
|
local sCId = BattleManager.GetCombatIdBySkin(sSkillId, 0)
|
|
|
|
|
local sCombat = BattleManager.GetSkillCombat(sCId)
|
2020-11-01 15:46:48 +08:00
|
|
|
|
self.st1.text = sCombat.BulletTime
|
|
|
|
|
self.st2.text = sCombat.KeyFrame
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- 应用数据
|
|
|
|
|
function SkillSetView:ApplyData()
|
|
|
|
|
local nSkillId = self.role.roleData.skill[1]
|
|
|
|
|
local sSkillId = self.role.roleData.superSkill[1]
|
|
|
|
|
|
|
|
|
|
self.roleView.spAtkTime = (tonumber(self.rt.text)or 0)/1000
|
|
|
|
|
self.roleView.atkSoundTime = (tonumber(self.rt2.text)or 0)/1000
|
|
|
|
|
|
2020-11-06 20:45:21 +08:00
|
|
|
|
local ncId = BattleManager.GetCombatIdBySkin(nSkillId, 0)
|
2020-11-01 15:46:48 +08:00
|
|
|
|
local nCombat = BattleManager.GetSkillCombat(ncId)
|
|
|
|
|
local nBulletTime = tonumber(self.nt1.text) or 0
|
|
|
|
|
local nKeyFrame = tonumber(self.nt2.text) or 0
|
|
|
|
|
nCombat.BulletTime = nBulletTime
|
|
|
|
|
nCombat.KeyFrame = nKeyFrame
|
|
|
|
|
BattleManager.SetSkillCombat(ncId, nCombat)
|
|
|
|
|
for i=2, #self.role.skill do
|
|
|
|
|
self.role.skill[2] = nKeyFrame/1000
|
|
|
|
|
end
|
|
|
|
|
|
2020-11-06 20:45:21 +08:00
|
|
|
|
local scId = BattleManager.GetCombatIdBySkin(sSkillId, 0)
|
2020-11-01 15:46:48 +08:00
|
|
|
|
local sCombat = BattleManager.GetSkillCombat(scId)
|
|
|
|
|
local sBulletTime = tonumber(self.st1.text) or 0
|
|
|
|
|
local sKeyFrame = tonumber(self.st2.text) or 0
|
|
|
|
|
sCombat.BulletTime = sBulletTime
|
|
|
|
|
sCombat.KeyFrame = sKeyFrame
|
|
|
|
|
BattleManager.SetSkillCombat(scId, sCombat)
|
|
|
|
|
for i=2, #self.role.superSkill do
|
|
|
|
|
self.role.superSkill[2] = sKeyFrame/1000
|
|
|
|
|
end
|
|
|
|
|
|
2021-03-02 16:53:12 +08:00
|
|
|
|
PopupTipPanel.ShowTip(Language[10212])
|
2020-11-01 15:46:48 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- 关闭界面
|
|
|
|
|
function SkillSetView:Close()
|
|
|
|
|
self.gameObject:SetActive(false)
|
|
|
|
|
end
|