法相相关脚本预设提交
parent
0b6d8ab978
commit
98ddf9b5c2
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 976896ad9c624f642a87a7053d0fe456
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -480,7 +480,9 @@ UIName = {
|
|||
GMSong10WanPanel=488,--送10万真充
|
||||
ItemBoxDropPopup=489,--背包宝箱奖励道具掉落弹窗
|
||||
HeroReplacePopup=490,--神将置换弹窗
|
||||
FaXiangStrongPopup=491,--法相强化界面
|
||||
FaXiangHandBook=491,--法相图鉴弹窗
|
||||
FaXiangStrongPopup=492,--法相强化界面
|
||||
|
||||
}
|
||||
|
||||
SubUIConfig = {
|
||||
|
|
|
|||
|
|
@ -66,13 +66,18 @@ function RoleInfoPopup:InitComponent()
|
|||
|
||||
this.equipInfo = Util.GetGameObject(self.transform, "Panel/Scroll View/Viewport/Content/EquipInfo")
|
||||
this.equipTitle=Util.GetGameObject(this.equipInfo,"BG/EquipTitle")
|
||||
this.babyTitle=Util.GetGameObject(this.equipInfo,"BG/BabyTitle")
|
||||
this.grid=Util.GetGameObject(this.equipInfo, "Grid")
|
||||
this.selsectEquipImage = Util.GetGameObject(this.equipInfo, "SelsectEquipImage")
|
||||
--装备
|
||||
this.equipGrid = Util.GetGameObject(this.grid, "EquipGrid")
|
||||
|
||||
--宝物、 法相
|
||||
this.specialEquipInfo=Util.GetGameObject(this.transform, "Panel/Scroll View/Viewport/Content/specialEquipInfo")
|
||||
this.babyTitle=Util.GetGameObject(this.specialEquipInfo,"BG/BabyTitle")
|
||||
--宝物
|
||||
this.babyGrid=Util.GetGameObject(this.grid, "BabyGrid")
|
||||
this.babyGrid=Util.GetGameObject(this.specialEquipInfo, "Grid/BabyGrid")
|
||||
--法相
|
||||
this.faXiangGrid=Util.GetGameObject(this.specialEquipInfo, "Grid/faXiangGrid")
|
||||
|
||||
--魂印
|
||||
this.soulPrintInfo = Util.GetGameObject(self.transform, "Panel/Scroll View/Viewport/Content/SoulPrintInfo")
|
||||
|
|
@ -458,9 +463,9 @@ function this.EquipInfo()
|
|||
Util.GetGameObject(this.babyGrid,"Pre"..m.."/Text"):GetComponent("RectTransform").sizeDelta = GetCurLanguage() == 0 and Vector2.New(48, 95) or Vector2.New(95, 95)
|
||||
end
|
||||
local b = #curHeroData.jewels>0
|
||||
this.babyTitle.gameObject:SetActive(b)
|
||||
this.babyGrid.gameObject:SetActive(b)
|
||||
local v3 = b and Vector2.New(-145,75) or Vector2.New(0,75)
|
||||
-- this.babyTitle.gameObject:SetActive(b)
|
||||
-- this.babyGrid.gameObject:SetActive(b)
|
||||
local v3 = b and Vector2.New(0,75) or Vector2.New(0,75)
|
||||
this.equipTitle.transform:DOAnchorPos(v3,0)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,166 @@
|
|||
---- 魂印图鉴 ----
|
||||
require("Base/BasePanel")
|
||||
FaXiangHandBook = Inherit(BasePanel)
|
||||
local this = FaXiangHandBook
|
||||
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
local orginLayer=0--层级
|
||||
local allSoulPrintData={}--所有魂印数据
|
||||
local curIndex = 0--当前选择索引
|
||||
|
||||
|
||||
local tabs = {}
|
||||
local list={}
|
||||
|
||||
function this:InitComponent()
|
||||
this.spLoader = SpriteLoader.New()
|
||||
this.backBtn = Util.GetGameObject(this.gameObject, "BackBtn")
|
||||
this.Title = Util.GetGameObject(this.gameObject, "Title"):GetComponent("Text")
|
||||
this.Title.text="法相图鉴"
|
||||
this.mask = Util.GetGameObject(this.gameObject, "mask")
|
||||
for i = 1, 5 do
|
||||
tabs[i] = Util.GetGameObject(this.gameObject, "Tabs/Btn" .. i)
|
||||
end
|
||||
this.selectBtn = Util.GetGameObject(this.gameObject, "Tabs/selectBtn")
|
||||
this.selectBtnText = Util.GetGameObject(this.selectBtn.transform, "Text"):GetComponent("Text")
|
||||
this.scrollRoot=Util.GetGameObject(this.gameObject,"ScrollRoot")
|
||||
this.pre=Util.GetGameObject(this.scrollRoot,"Pre")
|
||||
this.scrollView=SubUIManager.Open(SubUIConfig.ScrollCycleView,this.scrollRoot.transform,this.pre, nil,--
|
||||
Vector2.New(this.scrollRoot.transform.rect.width,this.scrollRoot.transform.rect.height),1,4,Vector2.New(50,15))
|
||||
this.scrollView.gameObject:GetComponent("RectTransform").anchoredPosition= Vector2.New(0,0)
|
||||
this.scrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5)
|
||||
this.scrollView.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5)
|
||||
this.scrollView.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5)
|
||||
this.scrollView.moveTween.MomentumAmount = 1
|
||||
this.scrollView.moveTween.Strength = 2
|
||||
|
||||
end
|
||||
|
||||
function this:BindEvent()
|
||||
--tab按钮点击
|
||||
for i = 1, 3 do
|
||||
Util.AddClick(tabs[i], function()
|
||||
if (curIndex == i) then
|
||||
return
|
||||
end
|
||||
|
||||
curIndex = i
|
||||
|
||||
this.OnRefresh(curIndex)
|
||||
this:SetSelect()
|
||||
end)
|
||||
end
|
||||
|
||||
--关闭页面
|
||||
Util.AddClick(this.backBtn, function()
|
||||
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
|
||||
self:ClosePanel()
|
||||
end)
|
||||
--关闭页面
|
||||
Util.AddClick(this.mask, function()
|
||||
PlaySoundWithoutClick(SoundConfig.Sound_UICancel)
|
||||
self:ClosePanel()
|
||||
end)
|
||||
end
|
||||
|
||||
function this:AddListener()
|
||||
end
|
||||
function this:RemoveListener()
|
||||
end
|
||||
|
||||
function this:OnSortingOrderChange()
|
||||
--特效层级重设
|
||||
for _, v in pairs(list) do
|
||||
Util.SetParticleSortLayer(v, this.sortingOrder+1)
|
||||
end
|
||||
orginLayer = self.sortingOrder
|
||||
end
|
||||
|
||||
function this:OnOpen()
|
||||
|
||||
end
|
||||
|
||||
function this:OnShow()
|
||||
this.GetAllData()
|
||||
curIndex=1
|
||||
this.OnRefresh(curIndex)
|
||||
this.SetBottomBarIsActive()
|
||||
this:SetSelect()
|
||||
end
|
||||
|
||||
function this:SetSelect()
|
||||
this.selectBtn:SetActive(true)
|
||||
this.selectBtn.transform.localPosition = tabs[curIndex].transform.localPosition
|
||||
this.selectBtnText.text = Util.GetGameObject(tabs[curIndex].transform, "Text"):GetComponent("Text").text
|
||||
end
|
||||
function this.GetAllData()
|
||||
allSoulPrintData = {}
|
||||
local faXiangConfigData= ConfigManager.GetConfig(ConfigName.FaxiangConfig)
|
||||
for i, configInfo in ConfigPairs(faXiangConfigData) do
|
||||
table.insert(allSoulPrintData,itemConfig[i])
|
||||
end
|
||||
end
|
||||
--特殊的开启条件
|
||||
function this.SetBottomBarIsActive()
|
||||
for i = 1, #tabs do
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
function this:OnClose()
|
||||
this.selectBtn:SetActive(false)
|
||||
end
|
||||
|
||||
function this:OnDestroy()
|
||||
this.spLoader:Destroy()
|
||||
list = {}
|
||||
this.scrollView=nil
|
||||
end
|
||||
|
||||
local orginLayer2=0
|
||||
--打开页面时,页面数据刷新
|
||||
function this.OnRefresh(index)
|
||||
local tempData={}
|
||||
|
||||
if index==0 then
|
||||
tempData=allSoulPrintData
|
||||
else
|
||||
for i,v in ipairs(allSoulPrintData) do
|
||||
if v.Quantity==(index+4) then
|
||||
table.insert( tempData, v)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--预设容器
|
||||
this.scrollView:SetData(tempData,function(index,root)
|
||||
this.SetScrollPre(root,tempData[index])
|
||||
list[root] = root
|
||||
end)
|
||||
this.scrollView:SetIndex(1)
|
||||
|
||||
orginLayer2 = this.sortingOrder
|
||||
orginLayer = this.sortingOrder
|
||||
end
|
||||
--设置预设
|
||||
function this.SetScrollPre(root,data)
|
||||
Util.SetParticleSortLayer(root, this.sortingOrder+1)
|
||||
SetSoulEffect(data.Quantity,root)
|
||||
local frame=Util.GetGameObject(root,"Frame"):GetComponent("Image")
|
||||
local icon=Util.GetGameObject(root,"circleFrameBg/Icon"):GetComponent("Image")
|
||||
local name=Util.GetGameObject(root,"Name"):GetComponent("Text")
|
||||
Util.AddOnceClick(root,function()
|
||||
UIManager.OpenPanel(UIName.GodPrintPopUp,0,nil,data.Id,nil)
|
||||
end)
|
||||
|
||||
frame.sprite=this.spLoader:LoadSprite(GetQuantityImageByquality(data.Quantity))
|
||||
icon.sprite=this.spLoader:LoadSprite(GetResourcePath(data.ResourceID))
|
||||
Util.GetGameObject(root,"circleFrameBg"):GetComponent("Image").sprite=this.spLoader:LoadSprite(SoulPrintSpriteByQuantity[data.Quantity].circleBg2)
|
||||
Util.GetGameObject(root,"circleFrameBg/circleFrame"):GetComponent("Image").sprite=this.spLoader:LoadSprite(SoulPrintSpriteByQuantity[data.Quantity].circle)
|
||||
local str = data.Name
|
||||
if GetCurLanguage() == 0 and LengthString(data.Name)>=5 then
|
||||
str = SubString(data.Name,4).."..."
|
||||
end
|
||||
name.text = str--SubString2(GetLanguageStrById(data.Name),10)
|
||||
end
|
||||
|
||||
return this
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6c8a76028996bb1459412a3f5900d715
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -128,6 +128,7 @@ function RoleEquipPanel:InitComponent()
|
|||
this.upLvEffect = Util.GetGameObject(self.transform, "powerBtn/effect")
|
||||
this.equipTreasureBtn = Util.GetGameObject(self.transform, "equipTreasureBtn")
|
||||
this.equipTreasureBtn:GetComponent("Image").sprite = this.spLoader:LoadSprite("b_baowuxitong_gongmin_zh")
|
||||
this.handBookBtn = Util.GetGameObject(self.transform, "handBookBtn")
|
||||
this.treasure1 = Util.GetGameObject(self.transform, "bg/equipInfo/equip5")
|
||||
this.treasure2 = Util.GetGameObject(self.transform, "bg/equipInfo/equip6")
|
||||
this.treasurePage1 = Util.GetGameObject(self.transform, "Tabs/Btn5")
|
||||
|
|
@ -198,6 +199,9 @@ function RoleEquipPanel:BindEvent()
|
|||
end
|
||||
UIManager.OpenPanel(UIName.EquipTreasureResonancePanel, curHeroData)
|
||||
end)
|
||||
Util.AddClick(this.handBookBtn,function()
|
||||
UIManager.OpenPanel(UIName.FaXiangHandBook)
|
||||
end)
|
||||
end
|
||||
|
||||
--添加事件监听(用于子类重写)
|
||||
|
|
|
|||
Loading…
Reference in New Issue