-- 全局设置界面 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 local nCId = BattleManager.GetCombatIdBySkin(nSkillId, 0) local nCombat = BattleManager.GetSkillCombat(nCId) self.nt1.text = nCombat.BulletTime self.nt2.text = nCombat.KeyFrame local sCId = BattleManager.GetCombatIdBySkin(sSkillId, 0) local sCombat = BattleManager.GetSkillCombat(sCId) 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 local ncId = BattleManager.GetCombatIdBySkin(nSkillId, 0) 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 local scId = BattleManager.GetCombatIdBySkin(sSkillId, 0) 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 PopupTipPanel.ShowTip(Language[10212]) end -- 关闭界面 function SkillSetView:Close() self.gameObject:SetActive(false) end