[立绘朝向]===============我方立绘展示朝向修改
parent
92e8420ec1
commit
69e30d908c
|
@ -537,6 +537,17 @@ function SetHeroStars(spLoader, starGrid, star, type,_starSize,_scale,_pivot,rot
|
|||
ForceRebuildLayout(starGrid.transform)
|
||||
end
|
||||
|
||||
--设置英雄立绘朝向
|
||||
function SetHEeroLiveToward(go,toward)
|
||||
if go and toward==1 then
|
||||
go.transform.rotation=Vector3.New(0,180,0)
|
||||
else
|
||||
go.transform.rotation=Vector3.New(0,0,0)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
function SetHeroBg(spLoader, bg,cardBg,star,quality)
|
||||
local hong = Util.GetGameObject(bg,"Effect_UI_yansekuang_HongSe")
|
||||
local bai = Util.GetGameObject(bg,"Effect_UI_yansekuang_BaiSe")
|
||||
|
|
|
@ -36,6 +36,7 @@ function this:OnOpen(heroTId, skinId, damageValue, allDamage, func,_func2)
|
|||
func2 = _func2
|
||||
-- 创建立绘
|
||||
local heroTData = {}
|
||||
local toward=0
|
||||
if heroTId > 0 then
|
||||
--如果有皮肤读取皮肤表里面的数据,没有读取hero表
|
||||
local data = nil
|
||||
|
@ -43,6 +44,7 @@ function this:OnOpen(heroTId, skinId, damageValue, allDamage, func,_func2)
|
|||
data = ConfigManager.GetConfigDataByKey(ConfigName.HeroSkin,"Type",skinId)
|
||||
else
|
||||
data= ConfigManager.GetConfigData(ConfigName.HeroConfig,heroTId)
|
||||
toward=data.Toward
|
||||
end
|
||||
heroTData.Live = GetResourcePath(data.Live)
|
||||
heroTData.Scale = data.Scale
|
||||
|
@ -64,6 +66,7 @@ function this:OnOpen(heroTId, skinId, damageValue, allDamage, func,_func2)
|
|||
this.liveName = heroTData.Live
|
||||
this.liveNode = poolManager:LoadLive(this.liveName, this.firstRole.transform, Vector3.one * heroTData.Scale, Vector3.New(heroTData.Position[1], heroTData.Position[2]))
|
||||
this.liveNode.transform.sizeDelta = Vector2.New(10, 10)
|
||||
SetHEeroLiveToward(this.liveNode,toward)
|
||||
local SkeletonGraphic = this.liveNode:GetComponent("SkeletonGraphic")
|
||||
local idle = function()
|
||||
SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true)
|
||||
|
|
|
@ -182,6 +182,7 @@ function TimeLimitUpHero:RefreshHeroData()
|
|||
end
|
||||
lastLiveName=GetResourcePath(curConfig.Live)
|
||||
heroLiveObj=HeroManager.LoadHerolive1(curConfig,self.heroPar)
|
||||
SetHEeroLiveToward(heroLiveObj,curConfig.Toward)
|
||||
local reMaintimes = ActivityGiftManager.GetActivityValueInfo(self.actId)
|
||||
local totalTimes = 0
|
||||
for i = 1, #wishConfig.UpList do
|
||||
|
|
|
@ -520,6 +520,7 @@ function this.SetCardSingleData(o, heroId, _pos, _heroData)
|
|||
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)
|
||||
SetHEeroLiveToward(live,heroData.heroConfig.Toward)
|
||||
live.transform.localScale = Vector3.one
|
||||
live.transform.localPosition = Vector3.zero
|
||||
|
||||
|
|
|
@ -657,6 +657,7 @@ function HandBookHeroAndEquipListPanel:OnShowSingleHeroData(...)
|
|||
|
||||
Util.GetGameObject(_go.transform, "card/name"):GetComponent("Text").text = GetLanguageStrById(heroData.ReadingName)
|
||||
Util.GetGameObject(_go.transform, "card/icon"):GetComponent("Image").sprite = self.spLoader:LoadSprite(GetResourcePath(heroData.Painting))
|
||||
SetHEeroLiveToward(Util.GetGameObject(_go.transform, "card/icon"),heroData.Toward)
|
||||
Util.GetGameObject(_go.transform, "card/pro/Image"):GetComponent("Image").sprite = self.spLoader:LoadSprite(GetProStrImageByProNum(heroData.PropertyName))
|
||||
Util.GetGameObject(_go.transform, "card/heroStage"):SetActive(false)
|
||||
local starGrid = Util.GetGameObject(_go.transform, "star")
|
||||
|
|
|
@ -402,6 +402,7 @@ function HeroLikeAbilityPanel:LoadHerolive1(_heroData, _objPoint)
|
|||
local icon = GetResourcePath(_heroData.Live)
|
||||
local testLive = poolManager:LoadLive(GetResourcePath(_heroData.Live), _objPoint.transform,
|
||||
Vector3.one * _heroData.Scale, Vector3.New(_heroData.Position[1], _heroData.Position[2], 0))
|
||||
SetHEeroLiveToward(testLive,_heroData.Toward)
|
||||
local SkeletonGraphic = testLive:GetComponent("SkeletonGraphic")
|
||||
local idle = function() SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true) end
|
||||
SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete + idle
|
||||
|
@ -443,7 +444,8 @@ function HeroLikeAbilityPanel:RightBtnOnClick()
|
|||
|
||||
self.leftLiveObj = self.curLiveObj
|
||||
self.curLiveObj = self.rightLiveObj
|
||||
self.rightLiveObj = HeroManager.LoadHerolive1(rightHeroData,self.rightObj)
|
||||
self.rightLiveObj = HeroManager.LoadHerolive1(rightHeroData,self.rightObj)
|
||||
SetHEeroLiveToward(self.rightLiveObj,rightHeroData.Toward)
|
||||
local SkeletonGraphic = self.curLiveObj:GetComponent("SkeletonGraphic")
|
||||
SkeletonGraphic.AnimationState:SetAnimation(0, "touch", false)
|
||||
if self.curLiveObj then
|
||||
|
@ -492,7 +494,8 @@ function HeroLikeAbilityPanel:LeftBtnOnClick()
|
|||
|
||||
self.rightLiveObj = self.curLiveObj
|
||||
self.curLiveObj = self.leftLiveObj
|
||||
self.leftLiveObj = HeroManager.LoadHerolive1(leftHeroData,self.leftObj)
|
||||
self.leftLiveObj = HeroManager.LoadHerolive1(leftHeroData,self.leftObj)
|
||||
SetHEeroLiveToward(self.leftLiveObj,rightHeroData.Toward)
|
||||
local SkeletonGraphic = self.curLiveObj:GetComponent("SkeletonGraphic")
|
||||
SkeletonGraphic.AnimationState:SetAnimation(0, "touch", false)
|
||||
if self.curLiveObj then
|
||||
|
|
|
@ -231,6 +231,7 @@ function LikeAbilityPanel:SingleHeroDataShow(_go,data)
|
|||
local bg = Util.GetGameObject(card, "bg")
|
||||
local icon = Util.GetGameObject(card, "icon"):GetComponent("Image")
|
||||
icon.sprite = self.spLoader:LoadSprite(GetResourcePath(data.Painting))
|
||||
SetHEeroLiveToward(icon.gameObject,data.Toward)
|
||||
SetHeroBg(self.spLoader,card ,bg ,data.Star,data.Quality)
|
||||
local pro = Util.GetGameObject(_go.transform, "card/pro/Image"):GetComponent("Image")
|
||||
pro.sprite = self.spLoader:LoadSprite(GetProStrImageByProNum(data.PropertyName))
|
||||
|
|
|
@ -123,6 +123,7 @@ function ExChangePage:ExChangeShow()
|
|||
self.liveName = GetResourcePath(self.heroConfig.Live)
|
||||
self.liveNode = poolManager:LoadLive(self.liveName, self.live2dRoot.transform,
|
||||
Vector3.one * exChangeConFig.HeroShowScale, Vector3.New(exChangeConFig.HeroShowLocation[1], exChangeConFig.HeroShowLocation[2],0))
|
||||
SetHEeroLiveToward(self.liveNode,self.heroConfig.Toward)
|
||||
self.proImage.sprite =self.spLoader:LoadSprite(GetProStrImageByProNum(self.heroConfig.PropertyName))
|
||||
self.heroName.text =GetLanguageStrById(self.heroConfig.ReadingName)
|
||||
SetTextVerTial(self.heroName,Vector3.New(129.9,3.7,0))
|
||||
|
|
|
@ -150,6 +150,7 @@ function RecruitPanelNew:OnShow(sortingOrder)
|
|||
local name = GetResourcePath(heroConfig.Live)
|
||||
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
|
||||
SetHEeroLiveToward(self.liveNode,heroConfig.Toward)
|
||||
local SkeletonGraphic = self.liveNode:GetComponent("SkeletonGraphic")
|
||||
local idle = function() SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true) end
|
||||
SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete + idle
|
||||
|
|
|
@ -413,6 +413,7 @@ function SingleRecruitPanel:UpdataPanelData(_heroData)
|
|||
--TODO:动态加载立绘
|
||||
testLiveGO = poolManager:LoadLive(GetResourcePath(heroStaticData.Live), self.live2dRoot.transform,
|
||||
Vector3.one * heroStaticData.Scale, Vector3.New(heroStaticData.Position[1],heroStaticData.Position[2],0))
|
||||
SetHEeroLiveToward(testLiveGO,heroStaticData.Toward)
|
||||
local SkeletonGraphic = testLiveGO:GetComponent("SkeletonGraphic")
|
||||
local idle = function() SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true) end
|
||||
SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete + idle
|
||||
|
|
|
@ -364,9 +364,11 @@ function this:RightBtnOnClick()
|
|||
this.curLiveObj = nil
|
||||
end
|
||||
Util.ClearChild(this.leftObj.transform)
|
||||
this.leftLiveObj = HeroManager.LoadHerolive(leftHeroData,this.leftObj)
|
||||
this.leftLiveObj = HeroManager.LoadHerolive(leftHeroData,this.leftObj)
|
||||
SetHEeroLiveToward(this.leftLiveObj,leftHeroData.heroConfig.Toward)
|
||||
this.curLiveObj = this.rightLiveObj
|
||||
this.rightLiveObj = HeroManager.LoadHerolive(rightHeroData,this.rightObj)
|
||||
this.rightLiveObj = HeroManager.LoadHerolive(rightHeroData,this.rightObj)
|
||||
SetHEeroLiveToward(this.rightLiveObj,rightHeroData.heroConfig.Toward)
|
||||
local SkeletonGraphic = this.curLiveObj:GetComponent("SkeletonGraphic")
|
||||
SkeletonGraphic.AnimationState:SetAnimation(0, "touch", false)
|
||||
this.rightBtn:GetComponent("Button").enabled = true
|
||||
|
@ -408,9 +410,11 @@ function this:LeftBtnOnClick()
|
|||
this.curLiveObj = nil
|
||||
end
|
||||
Util.ClearChild(this.rightObj.transform)
|
||||
this.rightLiveObj = HeroManager.LoadHerolive(rightHeroData,this.rightObj)
|
||||
this.rightLiveObj = HeroManager.LoadHerolive(rightHeroData,this.rightObj)
|
||||
SetHEeroLiveToward(this.rightLiveObj,rightHeroData.heroConfig.Toward)
|
||||
this.curLiveObj = this.leftLiveObj
|
||||
this.leftLiveObj = HeroManager.LoadHerolive(leftHeroData,this.leftObj)
|
||||
this.leftLiveObj = HeroManager.LoadHerolive(leftHeroData,this.leftObj)
|
||||
SetHEeroLiveToward(this.leftLiveObj,leftHeroData.heroConfig.Toward)
|
||||
local SkeletonGraphic = this.curLiveObj:GetComponent("SkeletonGraphic")
|
||||
SkeletonGraphic.AnimationState:SetAnimation(0, "touch", false)
|
||||
this.leftBtn:GetComponent("Button").enabled = true
|
||||
|
@ -712,6 +716,7 @@ function this:ChangeCurentHeroSkinLive(herodata)
|
|||
end
|
||||
if herodata then
|
||||
this.curLiveObj=HeroManager.LoadHerolive1(herodata,this.curObj)
|
||||
SetHEeroLiveToward(this.curLiveObj,herodata.heroConfig.Toward)
|
||||
-- 临时保存皮肤位置
|
||||
curHeroPosition = herodata.Position
|
||||
else
|
||||
|
@ -727,9 +732,11 @@ function this:ChangeCurentHeroSkinLive(herodata)
|
|||
end
|
||||
this.force.text = WarPower
|
||||
this.curLiveObj=HeroManager.LoadHerolive(curHeroData,this.curObj)
|
||||
SetHEeroLiveToward(this.curLiveObj,curHeroData.heroConfig.Toward)
|
||||
-- 清空临时保存的皮肤位置
|
||||
curHeroPosition = nil
|
||||
end
|
||||
|
||||
this:SetDragView()
|
||||
end
|
||||
|
||||
|
|
|
@ -241,6 +241,7 @@ function this.SingleHeroDataShow(_go,_heroData)
|
|||
|
||||
Util.GetGameObject(_go.transform, "card/name"):GetComponent("Text").text = GetLanguageStrById(heroData.heroConfig.ReadingName)
|
||||
Util.GetGameObject(_go.transform, "card/icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(heroData.painting)
|
||||
SetHEeroLiveToward(Util.GetGameObject(_go.transform, "card/icon"):GetComponent("Image"),heroData.heroConfig.Toward)
|
||||
-- Util.GetGameObject(_go.transform, "card/pos/icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(heroData.professionIcon)
|
||||
Util.GetGameObject(_go.transform, "card/pro/Image"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetProStrImageByProNum(heroData.heroConfig.PropertyName))
|
||||
Util.GetGameObject(_go.transform, "card/heroStage"):GetComponent("Image").sprite = this.spLoader:LoadSprite(HeroStageSprite[heroData.heroConfig.HeroStage])
|
||||
|
|
Loading…
Reference in New Issue