修改战斗位移BUG

onepiece_demo_arena
xiejun 2023-10-23 15:09:31 +08:00
parent baaa2e20bf
commit fe4dec2a64
2 changed files with 7 additions and 7 deletions

View File

@ -85,7 +85,7 @@ function SkillSetView:Show(camp, pos, BattleView)
self.nt7.text = nCombat.AttackDisplaceTime
self.nt8.text = nCombat.AttackDisplaceBackTime
self.nt9.text = nCombat.AttackDisplacement
self.nt10.text = nCombat.AttackDisplaceoffset==nil and "" or (nCombat.AttackDisplaceoffset[1][1].."#"..nCombat.AttackDisplaceoffset[1][2])
self.nt10.text = nCombat.AttackDisplaceoffset==nil and "" or (nCombat.AttackDisplaceoffset[1].."#"..nCombat.AttackDisplaceoffset[2])
self.nt11.text = nCombat.ActionTime
self.nt12.text = nCombat.SkillNumbetTime[1][1]==0 and "" or self:SetStr(nCombat.SkillNumbetTime)
self.nt14.text = nCombat.EffectType
@ -102,7 +102,7 @@ function SkillSetView:Show(camp, pos, BattleView)
self.st7.text = sCombat.AttackDisplaceTime
self.st8.text = sCombat.AttackDisplaceBackTime
self.st9.text = sCombat.AttackDisplacement
self.st10.text = sCombat.AttackDisplaceoffset==nil and "" or (sCombat.AttackDisplaceoffset[1][1].."#"..sCombat.AttackDisplaceoffset[1][2])
self.st10.text = sCombat.AttackDisplaceoffset==nil and "" or (sCombat.AttackDisplaceoffset[1].."#"..sCombat.AttackDisplaceoffset[2])
self.st11.text = sCombat.ActionTime
self.st12.text = sCombat.SkillNumbetTime[1][1]==0 and "" or self:SetStr(sCombat.SkillNumbetTime)
self.st14.text = sCombat.EffectType
@ -153,7 +153,7 @@ function SkillSetView:ApplyData()
local AttackDisplaceTime = tonumber(self.nt7.text) or 0
local AttackDisplaceBackTime = tonumber(self.nt8.text) or 0
local AttackDisplacement = tonumber(self.nt9.text) or 2
local AttackDisplaceoffset = self.nt10.text=="" and {[1]={[1]=0.6,[2]=0.2}} or {[1]={[1]=string.split(self.nt10.text, "#")[1],[2]=string.split(self.nt10.text, "#")[2]}}
local AttackDisplaceoffset = self.nt10.text=="" and {[1]=0.6,[2]=0.2} or {[1]=string.split(self.nt10.text, "#")[1],[2]=string.split(self.nt10.text, "#")[2]}
local Actiontime=tonumber(self.nt11.text) or 1000
local SkillNumbetTime=self:ApplyStr(self.nt12.text)
-- local Offset=self.nt13.text=="" and nil or {[1]=string.split(self.nt13.text, "#")[1],[2]=string.split(self.nt13.text, "#")[2]}
@ -188,7 +188,7 @@ function SkillSetView:ApplyData()
local sAttackDisplaceTime = tonumber(self.st7.text) or 0
local sAttackDisplaceBackTime = tonumber(self.st8.text) or 0
local sAttackDisplacement = tonumber(self.st9.text) or 2
local sAttackDisplaceoffset = self.st10.text=="" and {[1]={[1]=0.6,[2]=0.2}} or {[1]={[1]=tonumber(string.split(self.st10.text, "#")[1]),[2]=tonumber(string.split(self.st10.text, "#")[2])}}
local sAttackDisplaceoffset = self.st10.text=="" and {[1]=0.6,[2]=0.2} or {[1]=tonumber(string.split(self.st10.text, "#")[1]),[2]=tonumber(string.split(self.st10.text, "#")[2])}
local sActiontime=tonumber(self.st11.text) or 1000
local sSkillNumbetTime=self:ApplyStr(self.st12.text)
-- local sOffset=self.st13.text=="" and nil or {[1]=string.split(self.st13.text, "#")[1],[2]=string.split(self.st13.text, "#")[2]}

View File

@ -71,7 +71,7 @@ function SkillCaster:OnSkillCast(skill)
-- end
self.owner.RoleLiveGO.transform.parent.gameObject:GetComponent("Canvas").sortingOrder= self.owner.RoleLiveGO.transform.parent.gameObject:GetComponent("Canvas").sortingOrder+50
if combat.AttackDisplacement ==1 then
local displaceoffset={[1]={[1]=0.4,[2]=-0.2}}
local displaceoffset={[1]=0.4,[2]=-0.2}
-- if skill.type==2 and self.owner.superSkillAttackDisplaceoffset then
-- displaceoffset=self.owner.superSkillAttackDisplaceoffset
-- elseif self.owner.SkillAttackDisplaceoffset then
@ -84,7 +84,7 @@ function SkillCaster:OnSkillCast(skill)
local targets = skill:GetDirectTargets()
for _, target in ipairs(targets) do
local t= self.owner.RootPanel.GetRoleView(target)
self.owner.RoleLiveGO.transform:DOMove(Vector3.New(t.GameObject.transform.position.x-(self.owner.camp==0 and displaceoffset[1][1] or(-displaceoffset[1][1])),t.GameObject.transform.position.y+displaceoffset[1][2],t.GameObject.transform.position.z), combat.AttackDisplaceTime/1000, false):OnComplete(function ()
self.owner.RoleLiveGO.transform:DOMove(Vector3.New(t.GameObject.transform.position.x-(self.owner.camp==0 and displaceoffset[1] or(-displaceoffset[1])),t.GameObject.transform.position.y+displaceoffset[2],t.GameObject.transform.position.z), combat.AttackDisplaceTime/1000, false):OnComplete(function ()
if self.owner.OnSkillPlay then
self.owner:OnSkillPlay(type,combat)
end
@ -111,7 +111,7 @@ function SkillCaster:OnSkillCast(skill)
local targets = skill:GetDirectTargets()
for _, target in ipairs(targets) do
local t= self.owner.RootPanel.GetRoleView(target)
self.owner.RoleLiveGO.transform:DOMove(Vector3.New(t.GameObject.transform.position.x-(self.owner.camp==0 and displaceoffset[1][1] or(-displaceoffset[1][1])),t.GameObject.transform.position.y+displaceoffset[1][2],t.GameObject.transform.position.z), combat.AttackDisplaceTime/1000, false):OnComplete(function ()
self.owner.RoleLiveGO.transform:DOMove(Vector3.New(t.GameObject.transform.position.x-(self.owner.camp==0 and displaceoffset[1] or(-displaceoffset[1])),t.GameObject.transform.position.y+displaceoffset[2],t.GameObject.transform.position.z), combat.AttackDisplaceTime/1000, false):OnComplete(function ()
if self.owner.OnSkillPlay then
self.owner:OnSkillPlay(type,combat)
end