剧情对话背景修改提交
parent
3ca88e04a9
commit
f2b8f6af7c
|
@ -15,6 +15,7 @@ local lastSceneEffect
|
|||
-- 设置场景特效
|
||||
local orginLayer
|
||||
local static_callBack
|
||||
local bgName
|
||||
|
||||
function StoryDialoguePanel:InitComponent()
|
||||
this.spLoader = SpriteLoader.New()
|
||||
|
@ -47,6 +48,7 @@ function StoryDialoguePanel:InitComponent()
|
|||
this.effectRoot = Util.GetGameObject(self.gameObject, "effectRoot")
|
||||
-- 场景特效
|
||||
this.sceneEffect = Util.GetGameObject(self.gameObject, "scenceEffect")
|
||||
this.LiveBg=nil
|
||||
end
|
||||
|
||||
|
||||
|
@ -154,12 +156,22 @@ function this.RefreshPanel(eventId, isFirstOpen)
|
|||
this.jumpRoot:SetActive(isRightType)
|
||||
end
|
||||
-- 设置对话背景图
|
||||
local bgName = chapterEventPointData[eventId].DialogueBg
|
||||
bgName = chapterEventPointData[eventId].DialogueBg
|
||||
if not bgName or bgName == "" then
|
||||
this.Bg.gameObject:SetActive(false)
|
||||
else
|
||||
this.Bg.gameObject:SetActive(true)
|
||||
this.Bg.sprite = this.spLoader:LoadSprite(chapterEventPointData[eventId].DialogueBg)
|
||||
this.Bg.sprite = this.spLoader:LoadSprite(bgName)
|
||||
if this.Bg.sprite==nil then
|
||||
if this.LiveBg then
|
||||
GameObject.Destroy(this.LiveBg.gameObject)
|
||||
end
|
||||
this.LiveBg=poolManager:LoadLive(bgName, this.Bg.transform, Vector3.New(1.5,1.5,1.5), Vector3.zero)
|
||||
else
|
||||
if this.LiveBg then
|
||||
this.LiveBg:SetActive(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
StoryDialoguePanel:SetScenceEffect(eventId)
|
||||
|
||||
|
@ -314,7 +326,10 @@ end
|
|||
--界面销毁时调用(用于子类重写)
|
||||
function StoryDialoguePanel:OnDestroy()
|
||||
this.spLoader:Destroy()
|
||||
|
||||
if this.LiveBg then
|
||||
poolManager:UnLoadLive(bgName,this.LiveBg)
|
||||
this.LiveBg=nil
|
||||
end
|
||||
end
|
||||
|
||||
return StoryDialoguePanel
|
Loading…
Reference in New Issue