[角色朝向]=======立绘朝向修改

dev_chengFeng
wangzhenxing 2021-11-29 13:21:23 +08:00
parent c7ee28efc7
commit 1eb6115bc9
9 changed files with 21 additions and 9 deletions

View File

@ -538,9 +538,12 @@ function SetHeroStars(spLoader, starGrid, star, type,_starSize,_scale,_pivot,rot
end
--设置英雄立绘朝向
function SetHEeroLiveToward(go,toward)
function SetHEeroLiveToward(go,toward,pos)
if go and toward==1 then
go.transform.rotation=Vector3.New(0,180,0)
if pos then
go.transform.localPosition=Vector3.New(-pos[1],pos[2],0)
end
else
go.transform.rotation=Vector3.New(0,0,0)
end

View File

@ -156,6 +156,7 @@ function this.ShowTitleData(curHeroCompoundData)
this.compoundHerolive.texture = CardRendererManager.GetSpineTexture(1, liveName, Vector3.one * scale, livePos, true)
this.compoundHerolive.transform.localScale = Vector3.one
this.compoundHerolive.transform.localPosition = Vector3.zero
SetHEeroLiveToward(this.compoundHerolive,heroConfig.Toward)
this.compoundHeropro.sprite=this.spLoader:LoadSprite(GetProStrImageByProNum(heroConfig.PropertyName))
this.compoundHeroname.text=GetLanguageStrById(heroConfig.ReadingName)
if zsName == "" then

View File

@ -182,7 +182,7 @@ function TimeLimitUpHero:RefreshHeroData()
end
lastLiveName=GetResourcePath(curConfig.Live)
heroLiveObj=HeroManager.LoadHerolive1(curConfig,self.heroPar)
SetHEeroLiveToward(heroLiveObj,curConfig.Toward)
SetHEeroLiveToward(heroLiveObj,curConfig.Toward,curConfig.Position)
local reMaintimes = ActivityGiftManager.GetActivityValueInfo(self.actId)
local totalTimes = 0
for i = 1, #wishConfig.UpList do

View File

@ -156,6 +156,9 @@ function this.SetCardSingleData(o,monsterId, _pos)
local scale = roleConfig.play_liveScale
local livePos = Vector3.New(roleConfig.offset[1], roleConfig.offset[2], 0)
live.texture = CardRendererManager.GetSpineTexture(_pos, liveName, Vector3.one * scale, livePos, true)
if heroConfig.Toward==2 then
SetHEeroLiveToward(live,1)
end
live.transform.localScale = Vector3.one
live.transform.localPosition = Vector3.zero

View File

@ -185,7 +185,9 @@ function this.SetCardSingleData(o,monsterId, _pos)
live.texture = CardRendererManager.GetSpineTexture(_pos + 6, liveName, Vector3.one * scale, livePos, true)
live.transform.localScale = Vector3.one
live.transform.localPosition = Vector3.zero
if heroConfig.Toward==2 then
SetHEeroLiveToward(live,1)
end
local zs = Util.GetGameObject(o, "zs")
local zsName = GetHeroCardStarZs[curMonsterConfig.Star]
if zsName == "" then

View File

@ -375,6 +375,7 @@ function HandBookHeroInfoPanel:LoadHerolive(_heroData, _objPoint)
poolManager:SetLiveClearCall(_heroData.Live, testLive, function ()
SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete - idle
end)
SetHEeroLiveToward(testLive,_heroData.Toward,_heroData.Position)
return testLive
end

View File

@ -210,6 +210,7 @@ function IncarnationPanel:RefreshSingleCardPre(cardPre,data,isJump,index)
end
self.cardList[cardPre].icon.transform.localScale = Vector3.one
self.cardList[cardPre].icon.transform.localPosition = Vector3.zero
SetHEeroLiveToward(self.cardList[cardPre].icon.gameObject,heroConfig[data.heroId].Toward)
self.cardList[cardPre].proImage.sprite = self.spLoader:LoadSprite(GetProStrImageByProNum(data.property))
self.cardList[cardPre].cardBg.sprite = self.spLoader:LoadSprite(GetHeroCardStarFg[data.quality])
if isJump then

View File

@ -135,6 +135,7 @@ function ElementDrawCardPanelNew:BtnAction(index)
self.liveNode = poolManager:LoadLive(name, self.root.transform,Vector3.one *heroConfig.Scale, Vector3.New(heroConfig.Position[1], heroConfig.Position[2], 0))
self.liveNode.name = name
SkeletonGraphic = self.liveNode:GetComponent("SkeletonGraphic")
SetHEeroLiveToward(self.liveNode,heroConfig.Toward)
local idle = function() SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true) end
SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete + idle
poolManager:SetLiveClearCall(name, self.liveNode, function ()

View File

@ -365,10 +365,10 @@ function this:RightBtnOnClick()
end
Util.ClearChild(this.leftObj.transform)
this.leftLiveObj = HeroManager.LoadHerolive(leftHeroData,this.leftObj)
SetHEeroLiveToward(this.leftLiveObj,leftHeroData.heroConfig.Toward)
SetHEeroLiveToward(this.leftLiveObj,leftHeroData.heroConfig.Toward,leftHeroData.position)
this.curLiveObj = this.rightLiveObj
this.rightLiveObj = HeroManager.LoadHerolive(rightHeroData,this.rightObj)
SetHEeroLiveToward(this.rightLiveObj,rightHeroData.heroConfig.Toward)
SetHEeroLiveToward(this.rightLiveObj,rightHeroData.heroConfig.Toward,rightHeroData.position)
local SkeletonGraphic = this.curLiveObj:GetComponent("SkeletonGraphic")
SkeletonGraphic.AnimationState:SetAnimation(0, "touch", false)
this.rightBtn:GetComponent("Button").enabled = true
@ -411,10 +411,10 @@ function this:LeftBtnOnClick()
end
Util.ClearChild(this.rightObj.transform)
this.rightLiveObj = HeroManager.LoadHerolive(rightHeroData,this.rightObj)
SetHEeroLiveToward(this.rightLiveObj,rightHeroData.heroConfig.Toward)
SetHEeroLiveToward(this.rightLiveObj,rightHeroData.heroConfig.Toward,rightHeroData.position)
this.curLiveObj = this.leftLiveObj
this.leftLiveObj = HeroManager.LoadHerolive(leftHeroData,this.leftObj)
SetHEeroLiveToward(this.leftLiveObj,leftHeroData.heroConfig.Toward)
SetHEeroLiveToward(this.leftLiveObj,leftHeroData.heroConfig.Toward,leftHeroData.position)
local SkeletonGraphic = this.curLiveObj:GetComponent("SkeletonGraphic")
SkeletonGraphic.AnimationState:SetAnimation(0, "touch", false)
this.leftBtn:GetComponent("Button").enabled = true
@ -717,7 +717,7 @@ function this:ChangeCurentHeroSkinLive(herodata)
if herodata then
this.curLiveObj=HeroManager.LoadHerolive1(herodata,this.curObj)
if herodata.heroConfig then
SetHEeroLiveToward(this.curLiveObj,herodata.heroConfig.Toward)
SetHEeroLiveToward(this.curLiveObj,herodata.heroConfig.Toward,herodata.position)
end
-- 临时保存皮肤位置
@ -735,7 +735,7 @@ function this:ChangeCurentHeroSkinLive(herodata)
end
this.force.text = WarPower
this.curLiveObj=HeroManager.LoadHerolive(curHeroData,this.curObj)
SetHEeroLiveToward(this.curLiveObj,curHeroData.heroConfig.Toward)
SetHEeroLiveToward(this.curLiveObj,curHeroData.heroConfig.Toward,curHeroData.position)
-- 清空临时保存的皮肤位置
curHeroPosition = nil
end