龙珠修改

TCX_LongZhu
zhangjiannan 2024-10-11 19:11:47 +08:00
parent 13028d37d4
commit 3287d0b938
6 changed files with 328 additions and 262 deletions

View File

@ -8594,6 +8594,11 @@ PrefabInstance:
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 3461041183831773760, guid: 5499cdbed3f400441b21a8becb5b5e84,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3461869958402333818, guid: 5499cdbed3f400441b21a8becb5b5e84,
type: 3}
propertyPath: m_AnchoredPosition.y
@ -8649,6 +8654,26 @@ PrefabInstance:
propertyPath: m_TargetGraphic
value:
objectReference: {fileID: 3290334893541118100}
- target: {fileID: 3395823834833100134, guid: 5499cdbed3f400441b21a8becb5b5e84,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3395823834833100134, guid: 5499cdbed3f400441b21a8becb5b5e84,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3395823834833100134, guid: 5499cdbed3f400441b21a8becb5b5e84,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3395823834833100134, guid: 5499cdbed3f400441b21a8becb5b5e84,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 381753831834081747, guid: 5499cdbed3f400441b21a8becb5b5e84,
type: 3}
propertyPath: m_SizeDelta.x

View File

@ -853,7 +853,7 @@ MonoBehaviour:
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 0
m_Spacing: 0
m_Spacing: -40
m_ChildForceExpandWidth: 0
m_ChildForceExpandHeight: 0
m_ChildControlWidth: 0

View File

@ -17,7 +17,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &309311515
RectTransform:
m_ObjectHideFlags: 0
@ -754,7 +754,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 51.71, y: 2.600006}
m_AnchoredPosition: {x: 30, y: 2.600006}
m_SizeDelta: {x: 291.48, y: 30}
m_Pivot: {x: 0, y: 0}
--- !u!222 &3458859693125887700
@ -1063,7 +1063,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &3461425765958726042
RectTransform:
m_ObjectHideFlags: 0

View File

@ -8,7 +8,8 @@ local teamHero = {}
local roleDatas = {}
this.isFirstOpen = true
local tabs = {}
local tabsImg = {"z_icon_01_zh","r_hero_huo 1_zh", "r_hero_feng 1_zh", "r_hero_shui 1_zh", "r_hero_dadi 1_zh","z_icon_qingjinbao"}
local tabsImg = { "z_icon_01_zh", "r_hero_huo 1_zh", "r_hero_feng 1_zh", "r_hero_shui 1_zh", "r_hero_dadi 1_zh",
"z_icon_qingjinbao" }
local soulPrintData = {}
local orginLayer = 0
local orginLayer2 = 0
@ -23,6 +24,8 @@ function RoleListPanel:InitComponent()
this.cardPre:GetComponent("RectTransform").localScale = Vector3.New(1, 1, 1)
local starPre = poolManager:LoadAsset("starGrid", PoolManager.AssetType.GameObject)
starPre.transform:SetParent(Util.GetGameObject(self.transform, "card(Clone)/card/star").transform)
starPre.transform.localScale = Vector3.one
starPre.transform.localPosition = Vector3.zero
local particles1 = starPre:GetComponentsInChildren(typeof(UnityEngine.ParticleSystem))
for key, value in pairs(particles1:ToTable()) do
local mat = value:GetComponent(typeof(UnityEngine.Renderer))
@ -40,7 +43,8 @@ function RoleListPanel:InitComponent()
elseif mat.material.shader.name == "UI Particles/Additive" then
mat.material.shader = poolManager:LoadAsset("UI-Particle-Add_1", poolManager.AssetType.Other)
elseif mat.material.shader.name == "YXZ/Effect/Mix Masking(Without Moving)_alphablend" then
mat.material.shader=poolManager:LoadAsset("YXZ_MixMaskingWithoutMoving_alphablend_1",poolManager.AssetType.Other)
mat.material.shader = poolManager:LoadAsset("YXZ_MixMaskingWithoutMoving_alphablend_1",
poolManager.AssetType.Other)
end
end
local meshs = this.cardPre:GetComponentsInChildren(typeof(UnityEngine.MeshRenderer))
@ -90,19 +94,17 @@ function RoleListPanel:InitComponent()
--this.UpView.gameObject:AddComponent(typeof(UnityEngine.Canvas)).overrideSorting=true
--this.UpView.overrideSorting=true
local v2 = Util.GetGameObject(self.gameObject, "scroll"):GetComponent("RectTransform").rect
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, Util.GetGameObject(self.transform, "scroll").transform,
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView,
Util.GetGameObject(self.transform, "scroll").transform,
this.cardPre, this.ScrollBar, Vector2.New(-v2.x * 2, -v2.y * 2 + 20), 1, 5, Vector2.New(25, 8))
this.ScrollView.moveTween.MomentumAmount = 1
this.ScrollView.moveTween.Strength = 1
this.maxk = Util.GetGameObject(self.gameObject, "maxk")
end
--绑定事件(用于子类重写)
function RoleListPanel:BindEvent()
Util.AddClick(this.BtnBack, function()
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
HeroManager.heroListPanelSortID = SortTypeConst.Natural
@ -193,12 +195,10 @@ function this:OnSortingOrderChange()
-- if this.UpView then
-- SetParticleSortLayer(this.UpView,self.sortingOrder+2)
-- end
end
--界面打开时调用(用于子类重写)
function RoleListPanel:OnShow()
--检测成员红点
CheckRedPointStatus(RedPointType.Role)
@ -273,15 +273,19 @@ function this:SetRoleList(_roleDatas)
orginLayer2 = self.sortingOrder
orginLayer = self.sortingOrder
end
function this.SingleHeroDataShow(_go, _heroData)
local heroData = _heroData
SetHeroBg(this.spLoader, Util.GetGameObject(_go.transform, "card"),Util.GetGameObject(_go.transform, "card/bg"),_heroData.star,heroData.heroConfig.Quality,this.sortingOrder + 1)
SetHeroBg(this.spLoader, Util.GetGameObject(_go.transform, "card"), Util.GetGameObject(_go.transform, "card/bg"),
_heroData.star, heroData.heroConfig.Quality, this.sortingOrder + 1)
if HarmonyManager.IsChangeColor(heroData.dynamicId) then
Util.GetGameObject(_go.transform, "card/lv/Text"):GetComponent("Text").text = "<color=#0f0>"..heroData.lv.."</color>"
Util.GetGameObject(_go.transform, "card/lv/Text"):GetComponent("Text").text = "<color=#0f0>" ..
heroData.lv .. "</color>"
elseif HarmonyManager:IsEnvoy(heroData.dynamicId) and HarmonyManager.GetSingleAdditionsData(HarmonyAddType.AddLv) then
local temp = HarmonyManager.GetSingleAdditionsData(HarmonyAddType.AddLv)
if temp.heroTid == 0 and temp.value > 0 then
Util.GetGameObject(_go.transform, "card/lv/Text"):GetComponent("Text").text = "<color=#ffbe22>"..heroData.lv.."</color>"
Util.GetGameObject(_go.transform, "card/lv/Text"):GetComponent("Text").text = "<color=#ffbe22>" ..
heroData.lv .. "</color>"
else
Util.GetGameObject(_go.transform, "card/lv/Text"):GetComponent("Text").text = heroData.lv
end
@ -289,24 +293,30 @@ function this.SingleHeroDataShow(_go,_heroData)
Util.GetGameObject(_go.transform, "card/lv/Text"):GetComponent("Text").text = heroData.lv
end
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(GetResourcePath(heroData.heroConfig.ShowLive))
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(
GetResourcePath(heroData.heroConfig.ShowLive))
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/pos/icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(heroData
.professionIcon)
local imageCom = Util.GetGameObject(_go.transform, "card/pro/Image"):GetComponent("RectTransform")
--if heroData.changeProId == 1 or heroData.changeProId == 2 or heroData.changeProId == 3 or heroData.changeProId == 4 then
imageCom.sizeDelta = Vector2.New(30, 30)
--else
-- imageCom.sizeDelta=Vector2.New(60,30)
--end
imageCom.gameObject:GetComponent("Image").sprite= this.spLoader:LoadSprite(GetProStrImageByProNum(heroData.changeProId))
Util.GetGameObject(_go.transform, "card/heroStage"):GetComponent("Image").sprite = this.spLoader:LoadSprite(HeroStageSprite[heroData.heroConfig.HeroStage])
imageCom.gameObject:GetComponent("Image").sprite = this.spLoader:LoadSprite(GetProStrImageByProNum(heroData
.changeProId))
Util.GetGameObject(_go.transform, "card/heroStage"):GetComponent("Image").sprite = this.spLoader:LoadSprite(
HeroStageSprite[heroData.heroConfig.HeroStage])
Util.GetGameObject(_go.transform, "card/redAndLock"):SetActive(true)
local redPoint = Util.GetGameObject(_go.transform, "card/redAndLock/redPoint")
Util.GetGameObject(_go.transform, "card/redAndLock/lockImage"):SetActive(heroData.lockState == 1)
Util.GetGameObject(_go.transform, "card/core"):SetActive(heroData.heroConfig.Main == 1)
Util.GetGameObject(_go.transform, "card/starnum"):GetComponent("Text").text=_heroData.star.."/".._heroData.maxStar
Util.GetGameObject(_go.transform, "card/starnum"):GetComponent("Text").text = _heroData.star ..
"/" .. _heroData.maxStar
_go.transform.localScale = Vector3.one * 0.95
local starGrid = Util.GetGameObject(_go.transform, "star")
local starPre = Util.GetGameObject(_go.transform, "starPre")
@ -320,7 +330,7 @@ function this.SingleHeroDataShow(_go,_heroData)
elseif starType == 2 then
starSize = Vector2.New(60, 57)
end
-- SetHeroStars(this.spLoader, starGrid, star,starType,starSize,starScale)
SetHeroStars(this.spLoader, starGrid, star, starType, starSize, starScale)
Util.SetParticleSortLayer(starGrid, this.sortingOrder + 1)
--local cardBtn = Util.GetGameObject(_go.transform, "card(Clone)")
SoulPrintManager.UnLockSoulPrintPos(heroData)
@ -340,6 +350,7 @@ function this.SingleHeroDataShow(_go,_heroData)
this.OnClickEnterHeroInfo(heroData, HeroManager.heroSortedDatas, teamHero[heroData.dynamicId] ~= nil)
end)
end
function this:SetSelectBtn()
this.selectBtn.transform:SetParent(tabs[proId].transform)
this.selectBtn:GetComponent("RectTransform").localPosition = Vector3.zero
@ -437,7 +448,6 @@ function RoleListPanel:OnClose()
isFristOpenTime:Stop()
isFristOpenTime = nil
end
end
--界面销毁时调用(用于子类重写)
@ -453,8 +463,6 @@ function RoleListPanel:OnDestroy()
this.playerInfoView = nil
end
ClearRedPointObject(RedPointType.LikeabilityRed, this.haoganduRed)
end
return RoleListPanel

View File

@ -3,35 +3,57 @@ local MainShopPanel = Inherit(BasePanel)
local this = MainShopPanel
-- Tab管理器
local TabBox = require("Modules/Common/TabBox")
local _Tab2Sprite = {default = "x1_haoyou_biaoqian_weixuanzhong", select = "x1_haoyou_biaoqian_xuanzhong", lock = "s_shop_qieye_1"}
local _Tab2FontColor = { default = Color.New(255 / 255, 255 / 255, 255 / 255, 1),
local _Tab2Sprite = {
default = "x1_haoyou_biaoqian_weixuanzhong_quekou",
select = "x1_haoyou_biaoqian_xuanzhong",
lock =
"s_shop_qieye_1"
}
local _Tab2FontColor = {
default = Color.New(255 / 255, 255 / 255, 255 / 255, 1),
lock = Color.New(255 / 255, 255 / 255, 255 / 255, 1),
select = Color.New(255 / 255, 255 / 255, 255 / 255, 1) }
select = Color.New(255 / 255, 255 / 255, 255 / 255, 1)
}
local _ShopTypeConfig = ConfigManager.GetConfig(ConfigName.StoreTypeConfig)
local _ShopPage = {
[SHOP_PAGE.RECHARGE] = { -- 充值
default = "UI_hz_gonghui_31", lock = "UI_hz_gonghui_31", select = "UI_hz_gonghui_31",
rpType = RedPointType.Shop_Page_Recharge,name="充值商店"
default = "UI_hz_gonghui_31",
lock = "UI_hz_gonghui_31",
select = "UI_hz_gonghui_31",
rpType = RedPointType.Shop_Page_Recharge,
name = "充值商店"
},
[SHOP_PAGE.GENERAL] = { -- 杂货
default = "UI_hz_gonghui_32", lock = "UI_hz_gonghui_32", select = "UI_hz_gonghui_32",
rpType = RedPointType.Shop_Page_General,name="杂货商店"
default = "UI_hz_gonghui_32",
lock = "UI_hz_gonghui_32",
select = "UI_hz_gonghui_32",
rpType = RedPointType.Shop_Page_General,
name = "杂货商店"
},
[SHOP_PAGE.COIN] = { -- 代币
default = "UI_hz_gonghui_33", lock = "UI_hz_gonghui_33", select = "UI_hz_gonghui_33",
rpType = RedPointType.Shop_Page_Coin,name="代币商店"
default = "UI_hz_gonghui_33",
lock = "UI_hz_gonghui_33",
select = "UI_hz_gonghui_33",
rpType = RedPointType.Shop_Page_Coin,
name = "代币商店"
},
[SHOP_PAGE.PLAY] = { -- 玩法
default = "UI_hz_gonghui_34", lock = "UI_hz_gonghui_34", select = "UI_hz_gonghui_34",
rpType = RedPointType.Shop_Page_Play,name="玩法商店"
default = "UI_hz_gonghui_34",
lock = "UI_hz_gonghui_34",
select = "UI_hz_gonghui_34",
rpType = RedPointType.Shop_Page_Play,
name = "玩法商店"
},
[SHOP_PAGE.EXCHANGE] = { -- 兑换
default = "UI_hz_gonghui_31", lock = "UI_hz_gonghui_31", select = "UI_hz_gonghui_31", name = "兑换商店"
},
[SHOP_PAGE.JUMPSERVER] = { -- 云游
default = "UI_hz_gonghui_32", lock = "UI_hz_gonghui_32", select = "UI_hz_gonghui_32",
rpType = RedPointType.Shop_Page_Roam,name="宇宙生存挑战"
default = "UI_hz_gonghui_32",
lock = "UI_hz_gonghui_32",
select = "UI_hz_gonghui_32",
rpType = RedPointType.Shop_Page_Roam,
name = "宇宙生存挑战"
},
[SHOP_PAGE.YUANSHEN] = { -- 元神
default = "UI_hz_gonghui_33", lock = "UI_hz_gonghui_33", select = "UI_hz_gonghui_33", name = "元神商店"
@ -72,6 +94,7 @@ function MainShopPanel:InitComponent()
-- 上部货币显示
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.transform, { showType = UpViewOpenType.ShowLeft })
end
--绑定事件(用于子类重写)
function MainShopPanel:BindEvent()
-- 初始化Tab管理器
@ -97,14 +120,13 @@ function MainShopPanel:BindEvent()
Util.AddClick(this.vipDetailBtn, function()
UIManager.OpenPanel(UIName.VipPanelV2)
end)
end
--添加事件监听(用于子类重写)
function MainShopPanel:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, this.SetVipPartInfo)
end
--移除事件监听(用于子类重写)
function MainShopPanel:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold, this.SetVipPartInfo)
@ -147,7 +169,6 @@ function MainShopPanel:OnOpen(chooseShopType)
end
end
assert(this._ChoosePageIndex and this._ChooseShopIndex, Language[11887])
end
-- 打开,重新打开时回调
@ -216,6 +237,7 @@ function this.PageTabIsLockCheck(index)
end
return false
end
-- tab改变事件
function this.OnPageTabChange(index, lastIndex)
this._CurPageIndex = index
@ -277,6 +299,7 @@ function this.ShopTabAdapter(tab, index, status)
this.BindTabRedpot(shopType, redpot)
end
end
-- tab可用性检测
function this.ShopTabIsLockCheck(index)
local shopType = this._MainShopTypeList[index]
@ -290,6 +313,7 @@ function this.ShopTabIsLockCheck(index)
end
return false
end
-- tab改变事件
function this.OnShopTabChange(index, lastIndex)
if this._CurShopIndex == index then return end
@ -325,7 +349,6 @@ function this.OnShopTabChange(index, lastIndex)
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = config.ResourcesBar })
end
-- 绑定数据
local _PageBindData = {}
local _TabBindData = {}
@ -335,6 +358,7 @@ function this.BindPageRedpot(page, redpot)
BindRedPointObject(rpType, redpot)
_PageBindData[rpType] = redpot
end
function this.ClearPageRedpot(page)
-- 清除红点绑定
if page then -- 清除某个
@ -370,6 +394,7 @@ function this.GetTabRPType(shopType)
end
return rpType
end
--- 绑定红点
function this.BindTabRedpot(shopType, redpot)
local rpType = this.GetTabRPType(shopType)
@ -377,6 +402,7 @@ function this.BindTabRedpot(shopType, redpot)
BindRedPointObject(rpType, redpot)
_TabBindData[rpType] = redpot
end
--- 清除红点
function this.ClearTabRedpot(shopType)
-- 清除红点绑定
@ -396,6 +422,7 @@ end
--界面关闭时调用(用于子类重写)
function MainShopPanel:OnClose()
end
--界面销毁时调用(用于子类重写)
function MainShopPanel:OnDestroy()
this.spLoader:Destroy()
@ -438,4 +465,3 @@ function this.SetVipPartInfo()
end
return MainShopPanel

View File

@ -1,4 +1,3 @@
local _ShopTypeConfig = ConfigManager.GetConfig(ConfigName.StoreTypeConfig)
-- 通用得商店逻辑
local ShopView = {}
@ -14,6 +13,7 @@ function this:New(gameObject)
o.transform = gameObject.transform
return o
end
--初始化组件(用于子类重写)
function this:InitComponent()
self.spLoader = SpriteLoader.New()
@ -148,18 +148,22 @@ function this:BindEvent()
UIManager.OpenPanel(UIName.HelpPopup, self.ShopConfig.HelpId, self.helpPosition.x, self.helpPosition.y + 372) --因层级锚点原因,需手动调整高度
end)
end
--添加事件监听(用于子类重写)
function this:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Shop.OnShopInfoChange, self.RefreshShopInfo, self)
end
--移除事件监听(用于子类重写)
function this:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Shop.OnShopInfoChange, self.RefreshShopInfo, self)
end
--界面打开时调用(用于子类重写)
function this:OnOpen(...)
end
--界面关闭时调用(用于子类重写)
function this:OnClose()
self.spLoader:Destroy()
@ -277,8 +281,6 @@ function this:RefreshLive()
poolManager:SetLiveClearCall(self.ShopConfig.LiveName, self.liveNode, function()
SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete - idle
end)
end
-- 开始倒计时
@ -419,7 +421,6 @@ function this:RefreshBase()
-- else
self.contentBg:SetActive(false)
-- end
end
-- 刷新物品列表
@ -505,7 +506,10 @@ function this:ShopItemAdapter(shopItem, itemData)
itemName.text = SubString2(GetLanguageStrById(con.Name), 8)
if con.ItemType == ItemType.LingShouChip then
local haveCount = BagManager.GetTotalItemNum(con.Id)
itemName.text = itemName.text.."\n"..string.format("<color=%s><size=%s>%s(%s/%s)</size></color>",UIColorStr.BLACK, "25", "拥有:", haveCount, con.UsePerCount)
itemName.text = itemName.text ..
"\n" ..
string.format("<color=%s><size=%s>%s(%s/%s)</size></color>", UIColorStr.BLACK, "25", "拥有:", haveCount,
con.UsePerCount)
end
if con.ItemType == ItemType.Talisman then
itemDes.gameObject:SetActive(true)
@ -517,7 +521,6 @@ function this:ShopItemAdapter(shopItem, itemData)
else
itemDes.gameObject:SetActive(false)
end
else
itemDes.gameObject:SetActive(false)
end
@ -530,7 +533,8 @@ function this:ShopItemAdapter(shopItem, itemData)
local isDiscount = itemInfo.IsDiscount == 1
discountbg:SetActive(isDiscount)
if isDiscount then
discountbg:GetComponent("Image").sprite = self.spLoader:LoadSprite("s_shop_zhekou_0" .. itemInfo.DiscountDegree.."_zh")
discountbg:GetComponent("Image").sprite = self.spLoader:LoadSprite("s_shop_zhekou_0" ..
itemInfo.DiscountDegree .. "_zh")
end
end
-- 消耗物品的信息
@ -581,6 +585,11 @@ function this:ShopItemAdapter(shopItem, itemData)
local imgColor = isEmpty and Color.New(0.5, 0.5, 0.5, 1) or Color.New(1, 1, 1, 1)
local textA = isEmpty and 0.7 or 1
Util.SetColor(bg, imgColor)
local bgImage = Util.GetGameObject(bg, "Image")
imgColor = isEmpty and Color.New(0.5, 0.5, 0.5, 1) or Color.New(0.54, 0.38, 0.81, 1)
local pricebg = Util.GetGameObject(bg, "pricebg"):GetComponent("Image")
pricebg.color =isEmpty and Color.New(0.1, 0.1, 0.1, 1) or Color.New(0.15, 0.15, 0.15, 1)
Util.SetColor(bgImage, imgColor)
SetAlpha(itemName, textA)
--SetAlpha(limitTip, textA)
SetAlpha(itemPrice, textA)
@ -678,8 +687,6 @@ function this:RechargeShopItemAdapter(shopItem, itemData)
self:RechargeSuccessFunc(itemData.goodsId)
end)
end)
end
-- 充值成功回调