修改spine缩放不正常的bug

xiejun 2023-11-08 17:43:15 +08:00
parent 890e6b157d
commit 16859c0aa7
2 changed files with 7 additions and 4 deletions

View File

@ -109,11 +109,14 @@ function EnemyView:onCreate(go, role, position, root, isBoss,enemyId)
local combat = BattleManager.GetSkillCombat(combatId)
self.SkillAttackDisplaceoffset=combat.AttackDisplaceoffset
if combat.CloseRangeHit~=nil and combat.CloseRangeHit~="" then
self.RoleSkillLiveGo=poolManager:LoadLive(combat.CloseRangeHit, go.transform.parent, combat.CloseRangeHitScale==nil and Vector3.one or Vector3.New( combat.CloseRangeHitScale[1]/1000, combat.CloseRangeHitScale[2]/1000,1), Vector3.zero)
self.RoleSkillLiveGoTran = self.RoleSkillLiveGo:GetComponent("RectTransform")
self.RoleSkillLiveGoTran:SetParent(self.RoleLiveGO.transform)
LogError("3"..tostring(self.RoleSkillLiveGoTran.localScale))
self.RoleSkillLiveGoTran.anchoredPosition = Vector2.New(self.outOffset[1], self.outOffset[2])-- * 0.5
--self.RoleSkillLiveGoTran.localScale = Vector3.one
self.RoleSkillLiveGoTran.localScale = combat.CloseRangeHitScale==nil and Vector3.one or Vector3.New( combat.CloseRangeHitScale[1]/1000, combat.CloseRangeHitScale[2]/1000,1)
self.RoleSkillLiveGoTran.sizeDelta = Vector2.New(1000, 1000)
self.RoleSkillLiveGoGraphic = self.RoleSkillLiveGo:GetComponent("SkeletonGraphic")
self.RoleSkillLiveGoGraphic.AnimationState:SetAnimation(0, "idle", true)
@ -132,7 +135,7 @@ function EnemyView:onCreate(go, role, position, root, isBoss,enemyId)
self.RoleSkillLiveGoTran2.localPosition = Vector2.New(0, 0)-- * 0.5
end
-- self.RoleSkillLiveGoTran2.localScale = Vector3.one
self.RoleSkillLiveGoTran2.localScale = combat2.CloseRangeHitScale==nil and Vector3.one or Vector3.New( combat2.CloseRangeHitScale[1]/1000, combat2.CloseRangeHitScale[2]/1000,1)
self.RoleSkillLiveGoTran2.sizeDelta = Vector2.New(1000, 1000)
self.RoleSkillLiveGoGraphic2 = self.RoleSkillLiveGo2:GetComponent("SkeletonGraphic")
-- local t= self.RoleLiveGOGraphic.SkeletonData.animations

View File

@ -160,7 +160,7 @@ function PlayerView:onCreate(go, role, position, root)
self.RoleSkillLiveGoTran = self.RoleSkillLiveGo:GetComponent("RectTransform")
self.RoleSkillLiveGoTran:SetParent(self.RoleLiveGO.transform)
self.RoleSkillLiveGoTran.anchoredPosition = Vector2.New(self.outOffset[1], self.outOffset[2])-- * 0.5
-- self.RoleSkillLiveGoTran.localScale = Vector3.one
self.RoleSkillLiveGoTran.localScale = self.combat.CloseRangeHitScale==nil and Vector3.one or Vector3.New( self.combat.CloseRangeHitScale[1]/1000, self.combat.CloseRangeHitScale[2]/1000,1)
self.RoleSkillLiveGoTran.sizeDelta = Vector2.New(1000, 1000)
self.RoleSkillLiveGoGraphic = self.RoleSkillLiveGo:GetComponent("SkeletonGraphic")
self.RoleSkillLiveGoGraphic.AnimationState:SetAnimation(0, "idle", true)
@ -183,7 +183,7 @@ function PlayerView:onCreate(go, role, position, root)
else
self.RoleSkillLiveGoTran2.localPosition = Vector2.New(0, 0)-- * 0.5
end
--self.RoleSkillLiveGoTran2.localScale = Vector3.one
self.RoleSkillLiveGoTran2.localScale = self.combat2.CloseRangeHitScale==nil and Vector3.one or Vector3.New( self.combat2.CloseRangeHitScale[1]/1000, self.combat2.CloseRangeHitScale[2]/1000,1)
self.RoleSkillLiveGoTran2.sizeDelta = Vector2.New(1000, 1000)
self.RoleSkillLiveGoGraphic2 = self.RoleSkillLiveGo2:GetComponent("SkeletonGraphic")
-- local t= self.RoleLiveGOGraphic.SkeletonData.animations