zhangqiang 2020-10-15 20:52:15 +08:00
parent 45be005e63
commit 425023d697
4 changed files with 3846 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c5dabdb4fbd8ab94293938b3b3a77ab7
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,114 @@
require("Base/BasePanel")
PokemonGetInfoPopup = Inherit(BasePanel)
local this=PokemonGetInfoPopup
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
local pokemonBackData
local pokemonSid
local isGet
local proList = {}
--初始化组件(用于子类重写)
function PokemonGetInfoPopup:InitComponent()
this.BtnBack=Util.GetGameObject(self.transform, "bg/btnBack")
this.liveRoot=Util.GetGameObject(self.transform, "bg/liveRoot")
this.heroName = Util.GetGameObject(self.transform, "bg/nameInfo/nameText"):GetComponent("Text")
this.starGrid = Util.GetGameObject(self.transform, "bg/PokemonInfo/PokemonInfo")
--属性
for i = 1, 5 do
proList[i] = Util.GetGameObject(self.transform,"bg/PokemonInfo/pro/singlePro ("..i..")")
end
self.skillName=Util.GetGameObject(self.transform,"bg/PokemonInfo/nameText"):GetComponent("Text")
self.skillLv=Util.GetGameObject(self.transform,"bg/PokemonInfo/skillImage/LvText"):GetComponent("Text")
self.skillIcon=Util.GetGameObject(self.transform,"bg/PokemonInfo/icon"):GetComponent("Image")
end
local triggerCallBack
--绑定事件(用于子类重写)
function PokemonGetInfoPopup:BindEvent()
Util.AddClick(this.BtnBack, function()
self:ClosePanel()
end)
end
--添加事件监听(用于子类重写)
function PokemonGetInfoPopup:AddListener()
end
--移除事件监听(用于子类重写)
function PokemonGetInfoPopup:RemoveListener()
end
--界面打开时调用(用于子类重写)
function PokemonGetInfoPopup:OnOpen(_isGet,data)--data 未获得的时候为灵兽静态ID 获得的时候为本地数据
local data={...}
isGet=data[1]
if isGet then
pokemonBackData = data
else
pokemonSid = data
end
end
function PokemonGetInfoPopup:OnShow()
if isGet then
this.GetShowPanelData()
else
this.NoGetShowPanelData()
end
end
function this.GetShowPanelData()
local pokemonSData=ConfigManager.GetConfigData(ConfigName.SpiritAnimal, pokemonBackData.heroId)
this.ShowPokemonLive(pokemonSData)
--星级
SetHeroStars(this.starGrid, pokemonBackData.star,2,Vector2.New(60,60),-11.92,Vector2.New(0.5,0.5))
--属性
local allAddProVal=HeroManager.CalculateHeroAllProValList(1,heroBackData.id,false)
for i = 1, 5 do
Util.GetGameObject(proList[i].transform,"proName"):GetComponent("Text").text = ""
Util.GetGameObject(proList[i].transform,"proValue"):GetComponent("Text").text = ""
Util.GetGameObject(proList[i].transform,"Image"):GetComponent("Image").sprite =
Util.LoadSprite(GetResourcePath(ConfigManager.GetConfigData(ConfigName.ItemConfig,onePokemonSid).ResourceID))
end
end
function this.NoGetShowPanelData()
local pokemonSData=ConfigManager.GetConfigData(ConfigName.SpiritAnimal, pokemonSid)
this.ShowPokemonLive(pokemonSData)
--星级
SetHeroStars(this.starGrid, 0,2,Vector2.New(60,60),-11.92)
--属性
local allAddProVal = {}--this.CalculateHeroAllProValList(heroSData,heroStar,heroStar ~= heroSData.Star)
for i = 1, 5 do
Util.GetGameObject(proList[i].transform,"proName"):GetComponent("Text").text = ""
Util.GetGameObject(proList[i].transform,"proValue"):GetComponent("Text").text = ""
Util.GetGameObject(proList[i].transform,"Image"):GetComponent("Image").sprite =
Util.LoadSprite(GetResourcePath(ConfigManager.GetConfigData(ConfigName.ItemConfig,onePokemonSid).ResourceID))
end
end
function this.ShowPokemonLive(_heroSConfigData)
this.testLiveGO = poolManager:LoadLive(GetResourcePath(_heroSConfigData.Live), this.liveRoot.transform,
Vector3.one * _heroSConfigData.Scale*0.7, Vector3.New(_heroSConfigData.PositionView[1], _heroSConfigData.PositionView[2], 0))
local SkeletonGraphic = this.testLiveGO:GetComponent("SkeletonGraphic")
local idle = function() SkeletonGraphic.AnimationState:SetAnimation(0, "idle", true) end
SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete + idle
poolManager:SetLiveClearCall(GetResourcePath(_heroSConfigData.Live), this.testLiveGO, function ()
SkeletonGraphic.AnimationState.Complete = SkeletonGraphic.AnimationState.Complete - idle
end)
end
--界面关闭时调用(用于子类重写)
function PokemonGetInfoPopup:OnClose()
poolManager:UnLoadLive(this.testLiveGO.name, this.testLiveGO)
this.testLiveGO = nil
end
--界面销毁时调用(用于子类重写)
function PokemonGetInfoPopup:OnDestroy()
end
return PokemonGetInfoPopup

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8452b1e22ed89874c9784cd42666fda6
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: