【修行】恭喜破镜

dev_chengFeng
ZhangBiao 2021-05-19 18:27:57 +08:00
parent 3bb85fd5db
commit 7d5de9d23a
5 changed files with 81267 additions and 3826 deletions

View File

@ -18,7 +18,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &4319954644975728847
RectTransform:
m_ObjectHideFlags: 0
@ -36,10 +36,10 @@ RectTransform:
m_Father: {fileID: 1828482313430278523}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 300, y: 0}
m_SizeDelta: {x: 600, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 300, y: -107.5}
m_SizeDelta: {x: 600, y: 215}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4780749988992621811
CanvasRenderer:
@ -302,10 +302,10 @@ RectTransform:
m_Father: {fileID: 4319954644975728847}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 550, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 300, y: -145}
m_SizeDelta: {x: 550, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &902351682421173202
CanvasRenderer:

View File

@ -3,19 +3,29 @@ require("Base/BasePanel")
CongratulationPopup = Inherit(BasePanel)
local this = CongratulationPopup
local sorting = 0
local SkeletonGraphic
local idleFunc = function()
SkeletonGraphic.AnimationState:SetAnimation(0, "idle2", true)
end
--子模块脚本
local contentScripts = {
--神印信息
[CONGRATULATION_TYPE.Practice] = {view = require("Modules/GeneralPanel/View3/CongratulationPopup_Practice"), panelName = "CongratulationPopup_Practice"},
[CONGRATULATION_TYPE.Practice] = {view = require("Modules/GeneralPanel/View3/CongratulationPopup_Practice"), panelName = "CongratulationPopup_Practice",idleName = "idle1"},
}
--子模块预设
local contentPrefabs={}
--初始化组件(用于子类重写)
function CongratulationPopup:InitComponent()
this.contents = Util.GetGameObject(this.gameObject,"Content")
this.backBtn = Util.GetGameObject(this.gameObject,"backBtn")
sorting = 0
this.mask = Util.GetGameObject(this.gameObject,"Mask")
this.contents = Util.GetGameObject(this.gameObject,"Contents/Pages")
this.effect = Util.GetGameObject(this.gameObject,"Contents/Pages/Shows/UI_effect_FightEndLvUp")
this.roleEffect=Util.GetGameObject(self.transform, "Contents/Pages/Shows/npc")
this.roleEffect.gameObject:SetActive(true)
SkeletonGraphic = this.roleEffect:GetComponent("SkeletonGraphic")
SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete + idleFunc
--子模块脚本初始化
for key, value in pairs(contentScripts) do
@ -33,7 +43,7 @@ function CongratulationPopup:BindEvent()
value.view:BindEvent()
end
--返回按钮
Util.AddClick(this.backBtn,function()
Util.AddClick(this.mask,function()
self:ClosePanel()
end)
end
@ -51,13 +61,17 @@ function CongratulationPopup:RemoveListener()
end
function CongratulationPopup:OnSortingOrderChange()
this.sortingOrder = self.sortingOrder
Util.AddParticleSortLayer(this.effect,self.sortingOrder - sorting)
sorting = self.sortingOrder
end
function CongratulationPopup:OnOpen(popupKey,...)
this.effect:SetActive(true)
local SkeletonGraphic = this.roleEffect:GetComponent("SkeletonGraphic")
for key, value in pairs(contentPrefabs) do
value.gameObject:SetActive(false)
end
contentPrefabs[popupKey].gameObject:SetActive(true)
SkeletonGraphic.AnimationState:SetAnimation(0, contentScripts[popupKey].idleName, false)
contentScripts[popupKey].view:OnShow(this,...)--1、传入自己 2、传入不定参
end
@ -74,6 +88,7 @@ function CongratulationPopup:OnDestroy()
for key, value in pairs(contentScripts) do
value.view:OnDestroy()
end
SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete - idleFunc
end
return CongratulationPopup

View File

@ -6,6 +6,9 @@ local sortingOrder=0
--初始化组件(用于子类重写)
function this:InitComponent(gameObject)
this.title = Util.GetGameObject(gameObject,"title/Img"):GetComponent("Image")
this.text1 = Util.GetGameObject(gameObject,"Text1"):GetComponent("Text")
this.text2 = Util.GetGameObject(gameObject,"Text2/Text"):GetComponent("Text")
end
--绑定事件(用于子类重写)
@ -24,6 +27,10 @@ end
function this:OnShow(_parent,...)
parent=_parent
sortingOrder = _parent.sortingOrder
local data = ...
this.title.sprite = Util.LoadSprite(data.NamePic2)
this.text1.text = data.RealmDesc1
this.text2.text = data.RealmDesc2
end
--界面关闭时调用(用于子类重写)

View File

@ -67,7 +67,7 @@ function Practice:BindEvent()
end)
Util.AddClick(self.starBtn, function()
LogGreen("打开山河社稷图")
UIManager.OpenPanel(UIName.CongratulationPopup,CONGRATULATION_TYPE.Practice)
UIManager.OpenPanel(UIName.CongratulationPopup,CONGRATULATION_TYPE.Practice,self.curLevelConfig)
end)
Util.AddClick(self.button, function()
if self:UpgradeCheck() then return end