【角色信息】修复角色信息界面滑动立绘报错的问题
parent
39e8e1f894
commit
3baf785576
|
|
@ -301,9 +301,8 @@ function this:RightBtnOnClick()
|
||||||
this.rightLiveObj.transform:SetParent(this.curObj.transform)
|
this.rightLiveObj.transform:SetParent(this.curObj.transform)
|
||||||
this.rightLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(rightHeroData.position[1],rightHeroData.position[2]), 0.5, false):OnComplete(function ()
|
this.rightLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(rightHeroData.position[1],rightHeroData.position[2]), 0.5, false):OnComplete(function ()
|
||||||
this:UpdateLiveList()
|
this:UpdateLiveList()
|
||||||
this:UpdateHeroInfoData()
|
|
||||||
if this.curLiveObj then
|
if this.curLiveObj then
|
||||||
poolManager:UnLoadLive(this.curLiveObj.name, this.leftLiveObj)
|
poolManager:UnLoadLive(this.curLiveObj.name, this.curLiveObj)
|
||||||
this.curLiveObj = nil
|
this.curLiveObj = nil
|
||||||
end
|
end
|
||||||
Util.ClearChild(this.leftObj.transform)
|
Util.ClearChild(this.leftObj.transform)
|
||||||
|
|
@ -314,6 +313,8 @@ function this:RightBtnOnClick()
|
||||||
SkeletonGraphic.AnimationState:SetAnimation(0, "touch", false)
|
SkeletonGraphic.AnimationState:SetAnimation(0, "touch", false)
|
||||||
this.rightBtn:GetComponent("Button").enabled = true
|
this.rightBtn:GetComponent("Button").enabled = true
|
||||||
isClickLeftOrRightBtn = true
|
isClickLeftOrRightBtn = true
|
||||||
|
-- 更新显示,以及拖动组件目标
|
||||||
|
this:UpdateHeroInfoData()
|
||||||
end):SetEase(Ease.Linear)
|
end):SetEase(Ease.Linear)
|
||||||
this:SetPanelBg(curHeroData.heroConfig)
|
this:SetPanelBg(curHeroData.heroConfig)
|
||||||
end
|
end
|
||||||
|
|
@ -328,6 +329,7 @@ function this:LeftBtnOnClick()
|
||||||
local oldIndexConfigData = heroDatas[index]
|
local oldIndexConfigData = heroDatas[index]
|
||||||
index = (index - 1 > 0 and index - 1 or #heroDatas)
|
index = (index - 1 > 0 and index - 1 or #heroDatas)
|
||||||
curHeroData = heroDatas[index]
|
curHeroData = heroDatas[index]
|
||||||
|
--
|
||||||
if this.rightLiveObj then
|
if this.rightLiveObj then
|
||||||
poolManager:UnLoadLive(this.rightLiveObj.name, this.rightLiveObj)
|
poolManager:UnLoadLive(this.rightLiveObj.name, this.rightLiveObj)
|
||||||
this.rightLiveObj = nil
|
this.rightLiveObj = nil
|
||||||
|
|
@ -336,20 +338,25 @@ function this:LeftBtnOnClick()
|
||||||
this.curLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(oldIndexConfigData.position[1],oldIndexConfigData.position[2]), 0.5, false):SetEase(Ease.Linear)
|
this.curLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(oldIndexConfigData.position[1],oldIndexConfigData.position[2]), 0.5, false):SetEase(Ease.Linear)
|
||||||
this.leftLiveObj.transform:SetParent(this.curObj.transform)
|
this.leftLiveObj.transform:SetParent(this.curObj.transform)
|
||||||
this.leftLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(leftHeroData.position[1],leftHeroData.position[2]), 0.5, false):OnComplete(function ()
|
this.leftLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(leftHeroData.position[1],leftHeroData.position[2]), 0.5, false):OnComplete(function ()
|
||||||
|
-- 更新数据
|
||||||
this:UpdateLiveList()
|
this:UpdateLiveList()
|
||||||
this:UpdateHeroInfoData()
|
-- 销毁
|
||||||
if this.curLiveObj then
|
if this.curLiveObj then
|
||||||
poolManager:UnLoadLive(this.curLiveObj.name, this.rightLiveObj)
|
poolManager:UnLoadLive(this.curLiveObj.name, this.curLiveObj)
|
||||||
this.curLiveObj = nil
|
this.curLiveObj = nil
|
||||||
end
|
end
|
||||||
Util.ClearChild(this.rightObj.transform)
|
Util.ClearChild(this.rightObj.transform)
|
||||||
|
-- 创建新的live
|
||||||
this.rightLiveObj = HeroManager.LoadHerolive(rightHeroData,this.rightObj)
|
this.rightLiveObj = HeroManager.LoadHerolive(rightHeroData,this.rightObj)
|
||||||
this.curLiveObj = this.leftLiveObj
|
this.curLiveObj = this.leftLiveObj
|
||||||
this.leftLiveObj = HeroManager.LoadHerolive(leftHeroData,this.leftObj)
|
this.leftLiveObj = HeroManager.LoadHerolive(leftHeroData,this.leftObj)
|
||||||
|
-- 播放一次动画
|
||||||
local SkeletonGraphic = this.curLiveObj:GetComponent("SkeletonGraphic")
|
local SkeletonGraphic = this.curLiveObj:GetComponent("SkeletonGraphic")
|
||||||
SkeletonGraphic.AnimationState:SetAnimation(0, "touch", false)
|
SkeletonGraphic.AnimationState:SetAnimation(0, "touch", false)
|
||||||
this.leftBtn:GetComponent("Button").enabled = true
|
this.leftBtn:GetComponent("Button").enabled = true
|
||||||
isClickLeftOrRightBtn = true
|
isClickLeftOrRightBtn = true
|
||||||
|
-- 更新显示,以及拖动组件目标
|
||||||
|
this:UpdateHeroInfoData()
|
||||||
end):SetEase(Ease.Linear)
|
end):SetEase(Ease.Linear)
|
||||||
this:SetPanelBg(curHeroData.heroConfig)
|
this:SetPanelBg(curHeroData.heroConfig)
|
||||||
end
|
end
|
||||||
|
|
@ -466,56 +473,56 @@ function this:UpdateHeroInfoData()
|
||||||
this:OnPageTabChange(_CurPageIndex)
|
this:OnPageTabChange(_CurPageIndex)
|
||||||
|
|
||||||
local EquipSignUnlock = ConfigManager.GetConfigData(ConfigName.GameSetting,1).EquipSignUnlock
|
local EquipSignUnlock = ConfigManager.GetConfigData(ConfigName.GameSetting,1).EquipSignUnlock
|
||||||
if teamHero[curHeroData.dynamicId] then
|
if teamHero[curHeroData.dynamicId] then
|
||||||
isUpZhen = true
|
isUpZhen = true
|
||||||
this.equipBtnRedPoint:SetActive(#HeroManager.GetHeroIsUpEquip(curHeroData.dynamicId) > 0)
|
this.equipBtnRedPoint:SetActive(#HeroManager.GetHeroIsUpEquip(curHeroData.dynamicId) > 0)
|
||||||
this.talismanBtnRedPoint:SetActive(HeroManager.GetIsShowTalismanRedPoint(curHeroData))
|
this.talismanBtnRedPoint:SetActive(HeroManager.GetIsShowTalismanRedPoint(curHeroData))
|
||||||
this.soulPrintBtnRedPoint:SetActive(HeroManager.GetIsShowSoulPrintRedPoint(curHeroData))
|
this.soulPrintBtnRedPoint:SetActive(HeroManager.GetIsShowSoulPrintRedPoint(curHeroData))
|
||||||
else
|
else
|
||||||
isUpZhen = false
|
isUpZhen = false
|
||||||
this.equipBtnRedPoint:SetActive(false)
|
this.equipBtnRedPoint:SetActive(false)
|
||||||
this.talismanBtnRedPoint:SetActive(false)
|
this.talismanBtnRedPoint:SetActive(false)
|
||||||
this.soulPrintBtnRedPoint:SetActive(false)
|
this.soulPrintBtnRedPoint:SetActive(false)
|
||||||
end
|
end
|
||||||
--角色定位按钮
|
--角色定位按钮
|
||||||
this.posBtn.gameObject:SetActive(curHeroData.heroConfig.ShowHeroLocation==1)
|
this.posBtn.gameObject:SetActive(curHeroData.heroConfig.ShowHeroLocation==1)
|
||||||
--法宝按钮逻辑
|
--法宝按钮逻辑
|
||||||
this.talismanBtn.gameObject:SetActive(TalismanManager.CheckTalismanIsInConfig(curHeroData))
|
this.talismanBtn.gameObject:SetActive(TalismanManager.CheckTalismanIsInConfig(curHeroData))
|
||||||
if TalismanManager.CheckTalismanIsInConfig(curHeroData) then
|
if TalismanManager.CheckTalismanIsInConfig(curHeroData) then
|
||||||
talismanIsOpen = TalismanManager.GetCurHeroIsOpenTalisman(curHeroData)
|
talismanIsOpen = TalismanManager.GetCurHeroIsOpenTalisman(curHeroData)
|
||||||
this.talismanInfo.gameObject:SetActive(not talismanIsOpen)
|
this.talismanInfo.gameObject:SetActive(not talismanIsOpen)
|
||||||
Util.SetGray(this.talismanClick, not talismanIsOpen)
|
Util.SetGray(this.talismanClick, not talismanIsOpen)
|
||||||
Util.GetGameObject(this.talismanClick.transform, "lock"):SetActive(not talismanIsOpen)
|
Util.GetGameObject(this.talismanClick.transform, "lock"):SetActive(not talismanIsOpen)
|
||||||
if not talismanIsOpen then
|
if not talismanIsOpen then
|
||||||
Util.GetGameObject(this.talismanClick, "lock/Text"):GetComponent("Text").text = TalismanManager.GetCurHeroIsOpenTalismanStr()
|
Util.GetGameObject(this.talismanClick, "lock/Text"):GetComponent("Text").text = TalismanManager.GetCurHeroIsOpenTalismanStr()
|
||||||
end
|
|
||||||
end
|
|
||||||
--魂印按钮逻辑
|
|
||||||
if curHeroData.heroConfig.RankupConsumeMaterial then
|
|
||||||
this.soulPrintBtn:SetActive(PlayerManager.level>=EquipSignUnlock[1][2] and (#curHeroData.heroConfig.RankupConsumeMaterial + curHeroData.heroConfig.Star) >= EquipSignUnlock[2][2])
|
|
||||||
else
|
|
||||||
this.soulPrintBtn:SetActive(PlayerManager.level>=EquipSignUnlock[1][2] and curHeroData.heroConfig.Star >= EquipSignUnlock[2][2])
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
--魂印按钮逻辑
|
||||||
|
if curHeroData.heroConfig.RankupConsumeMaterial then
|
||||||
|
this.soulPrintBtn:SetActive(PlayerManager.level>=EquipSignUnlock[1][2] and (#curHeroData.heroConfig.RankupConsumeMaterial + curHeroData.heroConfig.Star) >= EquipSignUnlock[2][2])
|
||||||
|
else
|
||||||
|
this.soulPrintBtn:SetActive(PlayerManager.level>=EquipSignUnlock[1][2] and curHeroData.heroConfig.Star >= EquipSignUnlock[2][2])
|
||||||
|
end
|
||||||
|
|
||||||
if this.curLiveObj then
|
if this.curLiveObj then
|
||||||
this.dragView.gameObject:SetActive(true)
|
this.dragView.gameObject:SetActive(true)
|
||||||
this.dragView:SetDragGO(this.curLiveObj)
|
this.dragView:SetDragGO(this.curLiveObj)
|
||||||
else
|
else
|
||||||
this.dragView.gameObject:SetActive(false)
|
this.dragView.gameObject:SetActive(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
local starSize = Vector2.New(60,60)
|
local starSize = Vector2.New(60,60)
|
||||||
SetHeroStars(this.starGrid, curHeroData.star,2,starSize,-10,Vector2.New(0.5,0.5))
|
SetHeroStars(this.starGrid, curHeroData.star,2,starSize,-10,Vector2.New(0.5,0.5))
|
||||||
this.posImage.sprite =Util.LoadSprite(curHeroData.professionIcon)
|
this.posImage.sprite =Util.LoadSprite(curHeroData.professionIcon)
|
||||||
this.posText.text = GetJobStrByJobNum(curHeroData.profession)
|
this.posText.text = GetJobStrByJobNum(curHeroData.profession)
|
||||||
this.heroName.text = curHeroData.name
|
this.heroName.text = curHeroData.name
|
||||||
this.profession.sprite =Util.LoadSprite(GetProStrImageByProNum(curHeroData.heroConfig.PropertyName))
|
this.profession.sprite =Util.LoadSprite(GetProStrImageByProNum(curHeroData.heroConfig.PropertyName))
|
||||||
--定位描述相关
|
--定位描述相关
|
||||||
this.posBgImage.sprite=Util.LoadSprite(GetHeroPosBgStr(curHeroData.heroConfig.Profession))
|
this.posBgImage.sprite=Util.LoadSprite(GetHeroPosBgStr(curHeroData.heroConfig.Profession))
|
||||||
this.posImage.sprite=Util.LoadSprite(GetHeroPosStr(curHeroData.heroConfig.Profession))
|
this.posImage.sprite=Util.LoadSprite(GetHeroPosStr(curHeroData.heroConfig.Profession))
|
||||||
this.posText.text=curHeroData.heroConfig.HeroLocation
|
this.posText.text=curHeroData.heroConfig.HeroLocation
|
||||||
this.unlockImage:SetActive(curHeroData.lockState == 0)
|
this.unlockImage:SetActive(curHeroData.lockState == 0)
|
||||||
this.lockImage:SetActive(curHeroData.lockState == 1)
|
this.lockImage:SetActive(curHeroData.lockState == 1)
|
||||||
--魂印
|
--魂印
|
||||||
soulPrintIsOpen=SoulPrintManager.GetSoulPrintIsOpen(curHeroData)
|
soulPrintIsOpen=SoulPrintManager.GetSoulPrintIsOpen(curHeroData)
|
||||||
Util.GetGameObject(this.soulPrintBtn, "lock"):SetActive(not soulPrintIsOpen)
|
Util.GetGameObject(this.soulPrintBtn, "lock"):SetActive(not soulPrintIsOpen)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue