神魂初版提交

dev_chengFeng
jiaoyangna 2021-10-18 10:36:32 +08:00
parent ffde7813a0
commit 097d5cf1cc
17 changed files with 8392 additions and 162 deletions

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 255ede557cc3cd34299594deab09c6ae
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 0ef1c49e58385674280e74dff0adeaf1
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 278a3839fe4a0224c9b9510ca515ed8f
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -210,6 +210,7 @@ local ManagerNames = {
-- "WorldArena/WorldArenaManager",
--秘宝管理器
"GeneralPanel/GeneralTreasureMangaer",
"GodSoul/GodSoulManager",
--!!!!红点管理(尽量放在最后)!!!!--
"Player/RedpotManager",
}

View File

@ -456,6 +456,7 @@ SubUIConfig = {
SingleFightPlayerView = { name = "SingleFightPlayerView",assetName = "SingleFightPlayerView",script = "View/SingleFightPlayerView" }, -- 挂机界面一个人
SingleStoryPlayerView = { name = "SingleStoryPlayerView",assetName = "SingleStoryPlayerView",script = "View/SingleStoryPlayerView" } , --剧情界面一个对象
PlayerTitle = {name = "PlayerTitle",assetName = "PlayerTitle",script = "View/PlayerTitle"},
RoleGodSoulLayout = {name = "RoleGodSoulLayout",assetName = "RoleGodSoulLayout",script = "View/RoleGodSoulLayout"},
[1] = {name = "EveryDayGift",assetName = "EveryDayGift",script = "Modules/Recharge/View/EveryDayGift"},
[2] = {name = "GiftPre",assetName = "GiftPre",script = "Modules/Recharge/View/GiftPre"},
[3] = {name = "RechargeView",assetName = "RechargeView",script = "Modules/Recharge/View/RechargeView"},

View File

@ -79,6 +79,8 @@ HERO_LOCKSTATE_FIELD = protobuf.FieldDescriptor();
HERO_JEWELS_FIELD = protobuf.FieldDescriptor();
HERO_CREATETYPE_FIELD = protobuf.FieldDescriptor();
HERO_CHANGEID_FIELD = protobuf.FieldDescriptor();
HERO_GODSOULLIST_FIELD = protobuf.FieldDescriptor();
HERO_GODSOULBEBINDLIST_FIELD = protobuf.FieldDescriptor();
POKEMONINFO = protobuf.Descriptor();
POKEMONINFO_TEMPID_FIELD = protobuf.FieldDescriptor();
POKEMONINFO_ID_FIELD = protobuf.FieldDescriptor();
@ -766,6 +768,12 @@ RELIC_STATUS_FIELD = protobuf.FieldDescriptor();
LIKABLEINFO = protobuf.Descriptor();
LIKABLEINFO_HEROSTATICID_FIELD = protobuf.FieldDescriptor();
LIKABLEINFO_LIKABLENUM_FIELD = protobuf.FieldDescriptor();
HEROGODSOULINFO = protobuf.Descriptor();
HEROGODSOULINFO_LEVEL_FIELD = protobuf.FieldDescriptor();
HEROGODSOULINFO_HEROS_FIELD = protobuf.FieldDescriptor();
HEROBEBINDGODSOULINFO = protobuf.Descriptor();
HEROBEBINDGODSOULINFO_LEVEL_FIELD = protobuf.FieldDescriptor();
HEROBEBINDGODSOULINFO_HEROID_FIELD = protobuf.FieldDescriptor();
ERRORRESPONSE_ERRCODE_FIELD.name = "errCode"
ERRORRESPONSE_ERRCODE_FIELD.full_name = ".rpc.protocols.ErrorResponse.errCode"
@ -1496,11 +1504,33 @@ HERO_CHANGEID_FIELD.default_value = 0
HERO_CHANGEID_FIELD.type = 5
HERO_CHANGEID_FIELD.cpp_type = 1
HERO_GODSOULLIST_FIELD.name = "godSoulList"
HERO_GODSOULLIST_FIELD.full_name = ".rpc.protocols.Hero.godSoulList"
HERO_GODSOULLIST_FIELD.number = 17
HERO_GODSOULLIST_FIELD.index = 15
HERO_GODSOULLIST_FIELD.label = 3
HERO_GODSOULLIST_FIELD.has_default_value = false
HERO_GODSOULLIST_FIELD.default_value = {}
HERO_GODSOULLIST_FIELD.message_type = _HEROGODSOULINFO
HERO_GODSOULLIST_FIELD.type = 11
HERO_GODSOULLIST_FIELD.cpp_type = 10
HERO_GODSOULBEBINDLIST_FIELD.name = "godSoulBeBindList"
HERO_GODSOULBEBINDLIST_FIELD.full_name = ".rpc.protocols.Hero.godSoulBeBindList"
HERO_GODSOULBEBINDLIST_FIELD.number = 18
HERO_GODSOULBEBINDLIST_FIELD.index = 16
HERO_GODSOULBEBINDLIST_FIELD.label = 3
HERO_GODSOULBEBINDLIST_FIELD.has_default_value = false
HERO_GODSOULBEBINDLIST_FIELD.default_value = {}
HERO_GODSOULBEBINDLIST_FIELD.message_type = _HEROBEBINDGODSOULINFO
HERO_GODSOULBEBINDLIST_FIELD.type = 11
HERO_GODSOULBEBINDLIST_FIELD.cpp_type = 10
HERO.name = "Hero"
HERO.full_name = ".rpc.protocols.Hero"
HERO.nested_types = {}
HERO.enum_types = {}
HERO.fields = {HERO_ID_FIELD, HERO_HEROID_FIELD, HERO_LEVEL_FIELD, HERO_BREAKID_FIELD, HERO_STAR_FIELD, HERO_SKINID_FIELD, HERO_EQUIPIDLIST_FIELD, HERO_CREATETIME_FIELD, HERO_STARBREAKID_FIELD, HERO_ESPECIALEQUIPLEVEL_FIELD, HERO_SOULPOS_FIELD, HERO_LOCKSTATE_FIELD, HERO_JEWELS_FIELD, HERO_CREATETYPE_FIELD, HERO_CHANGEID_FIELD}
HERO.fields = {HERO_ID_FIELD, HERO_HEROID_FIELD, HERO_LEVEL_FIELD, HERO_BREAKID_FIELD, HERO_STAR_FIELD, HERO_SKINID_FIELD, HERO_EQUIPIDLIST_FIELD, HERO_CREATETIME_FIELD, HERO_STARBREAKID_FIELD, HERO_ESPECIALEQUIPLEVEL_FIELD, HERO_SOULPOS_FIELD, HERO_LOCKSTATE_FIELD, HERO_JEWELS_FIELD, HERO_CREATETYPE_FIELD, HERO_CHANGEID_FIELD, HERO_GODSOULLIST_FIELD, HERO_GODSOULBEBINDLIST_FIELD}
HERO.is_extendable = false
HERO.extensions = {}
POKEMONINFO_TEMPID_FIELD.name = "tempId"
@ -8058,6 +8088,60 @@ LIKABLEINFO.enum_types = {}
LIKABLEINFO.fields = {LIKABLEINFO_HEROSTATICID_FIELD, LIKABLEINFO_LIKABLENUM_FIELD}
LIKABLEINFO.is_extendable = false
LIKABLEINFO.extensions = {}
HEROGODSOULINFO_LEVEL_FIELD.name = "level"
HEROGODSOULINFO_LEVEL_FIELD.full_name = ".rpc.protocols.HeroGodSoulInfo.level"
HEROGODSOULINFO_LEVEL_FIELD.number = 1
HEROGODSOULINFO_LEVEL_FIELD.index = 0
HEROGODSOULINFO_LEVEL_FIELD.label = 1
HEROGODSOULINFO_LEVEL_FIELD.has_default_value = false
HEROGODSOULINFO_LEVEL_FIELD.default_value = 0
HEROGODSOULINFO_LEVEL_FIELD.type = 5
HEROGODSOULINFO_LEVEL_FIELD.cpp_type = 1
HEROGODSOULINFO_HEROS_FIELD.name = "heros"
HEROGODSOULINFO_HEROS_FIELD.full_name = ".rpc.protocols.HeroGodSoulInfo.heros"
HEROGODSOULINFO_HEROS_FIELD.number = 2
HEROGODSOULINFO_HEROS_FIELD.index = 1
HEROGODSOULINFO_HEROS_FIELD.label = 3
HEROGODSOULINFO_HEROS_FIELD.has_default_value = false
HEROGODSOULINFO_HEROS_FIELD.default_value = {}
HEROGODSOULINFO_HEROS_FIELD.type = 9
HEROGODSOULINFO_HEROS_FIELD.cpp_type = 9
HEROGODSOULINFO.name = "HeroGodSoulInfo"
HEROGODSOULINFO.full_name = ".rpc.protocols.HeroGodSoulInfo"
HEROGODSOULINFO.nested_types = {}
HEROGODSOULINFO.enum_types = {}
HEROGODSOULINFO.fields = {HEROGODSOULINFO_LEVEL_FIELD, HEROGODSOULINFO_HEROS_FIELD}
HEROGODSOULINFO.is_extendable = false
HEROGODSOULINFO.extensions = {}
HEROBEBINDGODSOULINFO_LEVEL_FIELD.name = "level"
HEROBEBINDGODSOULINFO_LEVEL_FIELD.full_name = ".rpc.protocols.HeroBeBindGodSoulInfo.level"
HEROBEBINDGODSOULINFO_LEVEL_FIELD.number = 1
HEROBEBINDGODSOULINFO_LEVEL_FIELD.index = 0
HEROBEBINDGODSOULINFO_LEVEL_FIELD.label = 1
HEROBEBINDGODSOULINFO_LEVEL_FIELD.has_default_value = false
HEROBEBINDGODSOULINFO_LEVEL_FIELD.default_value = 0
HEROBEBINDGODSOULINFO_LEVEL_FIELD.type = 5
HEROBEBINDGODSOULINFO_LEVEL_FIELD.cpp_type = 1
HEROBEBINDGODSOULINFO_HEROID_FIELD.name = "heroId"
HEROBEBINDGODSOULINFO_HEROID_FIELD.full_name = ".rpc.protocols.HeroBeBindGodSoulInfo.heroId"
HEROBEBINDGODSOULINFO_HEROID_FIELD.number = 2
HEROBEBINDGODSOULINFO_HEROID_FIELD.index = 1
HEROBEBINDGODSOULINFO_HEROID_FIELD.label = 1
HEROBEBINDGODSOULINFO_HEROID_FIELD.has_default_value = false
HEROBEBINDGODSOULINFO_HEROID_FIELD.default_value = ""
HEROBEBINDGODSOULINFO_HEROID_FIELD.type = 9
HEROBEBINDGODSOULINFO_HEROID_FIELD.cpp_type = 9
HEROBEBINDGODSOULINFO.name = "HeroBeBindGodSoulInfo"
HEROBEBINDGODSOULINFO.full_name = ".rpc.protocols.HeroBeBindGodSoulInfo"
HEROBEBINDGODSOULINFO.nested_types = {}
HEROBEBINDGODSOULINFO.enum_types = {}
HEROBEBINDGODSOULINFO.fields = {HEROBEBINDGODSOULINFO_LEVEL_FIELD, HEROBEBINDGODSOULINFO_HEROID_FIELD}
HEROBEBINDGODSOULINFO.is_extendable = false
HEROBEBINDGODSOULINFO.extensions = {}
ActivityInfo = protobuf.Message(ACTIVITYINFO)
ActivityInfo.MissionInfo = protobuf.Message(ACTIVITYINFO_MISSIONINFO)
@ -8114,7 +8198,9 @@ HardStagePlayerInfo = protobuf.Message(HARDSTAGEPLAYERINFO)
HeadFrameList = protobuf.Message(HEADFRAMELIST)
HelpFightList = protobuf.Message(HELPFIGHTLIST)
Hero = protobuf.Message(HERO)
HeroBeBindGodSoulInfo = protobuf.Message(HEROBEBINDGODSOULINFO)
HeroBloodInfo = protobuf.Message(HEROBLOODINFO)
HeroGodSoulInfo = protobuf.Message(HEROGODSOULINFO)
Item = protobuf.Message(ITEM)
ItemInfo = protobuf.Message(ITEMINFO)
JourneyCell = protobuf.Message(JOURNEYCELL)

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ca3665f088f97e145a8a93330638f70b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,150 @@
GodSoulManager = {}
local this = GodSoulManager
this.heroDatas = {}
function this.Initialize()
end
function this.InitializeTableData()
end
function this.BindHeroDatas(heroData)
if not this.heroDatas[heroData.id] then
this.heroDatas[heroData.id] = {}
end
if not this.heroDatas[heroData.id].BindHeroDatas then
this.heroDatas[heroData.id].BindHeroDatas = {} --绑定了哪些神将
this.heroDatas[heroData.id].BindToHeroDatas = {} --被绑定了哪些神将
end
for k,v in ipairs(heroData.godSoulList) do
if not this.heroDatas[heroData.id].BindHeroDatas[v.level] then
this.heroDatas[heroData.id].BindHeroDatas[v.level] = {}
end
for n,m in ipairs(v.heros) do
if this.CheckExistBindHeroDataByDid(heroData.id,m) > 0 then
else
table.insert(this.heroDatas[heroData.id].BindHeroDatas[v.level],m)
this.BingToHeroData(heroData.id,v.level,m)
end
end
end
HeroPropManager.SetDirtyByType(heroData.id,Hero_Prop_Type.GodSoul)
end
function this.GetGodSoulLv(curId)
local level = 0
if not this.heroDatas[curId] then
return level
end
local existLevel = {}
local unExistLevel = {}
for k,v in pairs(this.heroDatas[curId].BindHeroDatas) do
if #v > 0 and level < k then
level = k
end
end
return level
end
function this.BingToHeroData(targetId,tarGetLv,Id)
if not this.heroDatas[Id] then
this.heroDatas[Id] = {}
end
if not this.heroDatas[Id].BindHeroDatas then
this.heroDatas[Id].BindHeroDatas = {} --绑定了哪些神将
this.heroDatas[Id].BindToHeroDatas = {} --被绑定了哪些神将
end
if not this.heroDatas[Id].BindToHeroDatas[targetId] then
this.heroDatas[Id].BindToHeroDatas[targetId] = {}
end
this.heroDatas[Id].BindToHeroDatas[targetId] = tarGetLv
end
--检测curId 是否绑定了bindId
function this.CheckExistBindHeroDataByDid(curId,bindId)
local level = 0
if not this.heroDatas[curId] then
return level
end
if not this.heroDatas[curId].BindHeroDatas then
return level
end
for k,v in pairs(this.heroDatas[curId].BindHeroDatas) do
for n,m in ipairs(v) do
if v == bindId then
return k
end
end
end
return level
end
--检测 curId 是否被 bindId 绑定
function this.CheckExistBindToHeroDataByDid(curId,bindId)
if not this.heroDatas[curId] then
return false
end
if not this.heroDatas[curId].BindHeroDatas then
return false
end
if not this.heroDatas[curId].BindToHeroDatas[bindId] or this.heroDatas[curId].BindToHeroDatas[bindId] == 0 then
return false
end
return this.heroDatas[curId].BindToHeroDatas[bindId]
end
--解除curId,curlv绑定的
function this.UnBindHeroDatas(curId,curlv)
if not this.heroDatas[curId] then
return
end
if not this.heroDatas[curId].BindHeroDatas then
return
end
for k,v in pairs(this.heroDatas[curId].BindHeroDatas) do
if k >= curlv then
for n,m in ipairs(v) do
this.UnBindToHeroDatas(m,curId)
return
end
this.heroDatas[curId].BindHeroDatas[k] = {}
end
end
HeroPropManager.SetDirtyByType(curId,Hero_Prop_Type.GodSoul)
end
--解除bindId被绑定的curId
function this.UnBindToHeroDatas(bindId,curId)
if not this.heroDatas[bindId] then
return
end
if not this.heroDatas[bindId].BindToHeroDatas then
return
end
if not this.heroDatas[bindId].BindToHeroDatas[curId] or this.heroDatas[bindId].BindToHeroDatas[curId] == 0 then
return
end
this.heroDatas[bindId].BindToHeroDatas[curId] = nil
end
--删除一个神将
function this.DeleteHeroId(heroId)
if not this.heroDatas[heroId] then
return false
end
this.UnBindHeroDatas(heroId,1)
if not this.heroDatas[heroId].BindToHeroDatas then
return false
end
for k,v in pairs(this.heroDatas[heroId].BindToHeroDatas) do
if v > 0 then
this.UnBindHeroDatas(k,v)
end
end
this.heroDatas[heroId] = {}
end
return this

View File

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

View File

@ -190,6 +190,8 @@ function this.UpdateHeroDatas(_msgHeroData, isFindHandBook)
heroData.warPower = 0--HeroPowerManager.GetHeroPower(heroData.dynamicId)
--远征初始化血量
--ExpeditionManager.InitHeroHpValue(heroData)
GodSoulManager.BindHeroDatas(_msgHeroData)
end
-- 获取所有英雄数据
@ -527,6 +529,7 @@ function this.DeleteHeroDatas(heroDIds)
SoulPrintManager.hasEquipSoulPrintId[heroDIds[i]] = nil
--删除远征英雄数据
ExpeditionManager.DelHeroHpValue(heroDatas[heroDIds[i]])
GodSoulManager.DeleteHeroId(heroDIds[i])
--删除英雄
heroDatas[heroDIds[i]] = nil
end

View File

@ -18,6 +18,7 @@ Hero_Prop_Type = {
SoulPrint = 6, -- 魂印
SkinAdd = 7, -- 皮肤
LikeAbility = 8, -- 好感度
GodSoul = 9, -- 神魂
}

View File

@ -0,0 +1,699 @@
require("Base/BasePanel")
RoleInfoLayout = Inherit(BasePanel)
local this = RoleInfoLayout
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local heroRankupConfig = ConfigManager.GetConfig(ConfigName.HeroRankupConfig)
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
local heroSkinConfig = ConfigManager.GetConfig(ConfigName.HeroSkin)
local costItemList--升级突破静态材料
local isUpLvMaterials=true--升级 突破 材料是否充足
local allAddProVal={}--所有属性加成值
local lvUpShowProList={}--升级后展示的属性提升list
local isHeroUpTuPo=false--是否可突破
local upTuPoRankUpConfig={}--即将要突破的数据
local upStarRankUpConfig={}--即将要升星的数据
local curStarRankUpConfig={}--当前升星的数据
local curTuPoRankUpConfig={}--当前突破的数据
--长按升级状态
local _isClicked = false
local _isReqLvUp = false
local _isLongPress = false
this.timePressStarted = 0--监听长按事件
this.priThread = nil--协同程序播放升级属性提升值动画用
local isTriggerLongClick = false--长按是否升过级
local pinjieImage={"r_hero_pinjiebiao_01","r_hero_pinjiebiao_02"} --该死的品阶图片 1是未激活 2是激活
local oldLv = 0
local curHeroData--当前英雄信息
local parent = {}
local isUpZhen = false--当前英雄是否上阵
local isHeroUpStar
local herodatas = {}
this.isPressed = false
function RoleInfoLayout:New(gameObject)
local b = {}
b.gameObject = gameObject
b.transform = gameObject.transform
setmetatable(b, { __index = RoleInfoLayout })
return b
end
--初始化组件(用于子类重写)
function RoleInfoLayout:InitComponent()
this.spLoader = SpriteLoader.New()
--情报
this.atkPro=Util.GetGameObject(self.gameObject,"pro/atk")
this.hpPro=Util.GetGameObject(self.gameObject,"pro/hp")
this.phyDef=Util.GetGameObject(self.gameObject,"pro/phyDef")
this.magDef=Util.GetGameObject(self.gameObject,"pro/magDef")
this.lv = Util.GetGameObject(self.gameObject,"pro/lv/proValue"):GetComponent("Text")
this.skillGrid=Util.GetGameObject(self.gameObject,"skill")
this.selsectSkillImage=Util.GetGameObject(self.gameObject,"selsectSkillImage")
this.baseAttri = Util.GetGameObject(self.gameObject,"Ima/Text"):GetComponent("Text")
this.allProButton=Util.GetGameObject(self.gameObject,"allProButton")
this.pinjieList={}--品阶预设容器
this.pinjieRoot=Util.GetGameObject(self.gameObject,"Pinjie")
this.pinjiePre=Util.GetGameObject(self.gameObject,"Pre")
--升级
this.itemPre=Util.GetGameObject(self.gameObject,"upLv/itemPre")
this.itemGrid=Util.GetGameObject(self.gameObject,"upLv/itemGrid")
this.upLvBtn=Util.GetGameObject(self.gameObject,"upLvBtn")
this.upLvBtnRedPoint=Util.GetGameObject(self.gameObject,"upLvBtn/redPoint")
this.upLvTrigger = Util.GetEventTriggerListener(this.upLvBtn)
this.upLvBtnText=Util.GetGameObject(self.gameObject,"upLvBtn/Text"):GetComponent("Text")
this.upLvBtnImage=Util.GetGameObject(self.gameObject,"upLvBtn"):GetComponent("Image")
this.upLvBtnTiShiText=Util.GetGameObject(self.gameObject,"upLv/Image/Text"):GetComponent("Text")
this.upLvGoldBtn=Util.GetGameObject(self.gameObject,"upLv/gold")
this.upLvGoldText=Util.GetGameObject(self.gameObject,"upLv/gold/Text"):GetComponent("Text")
this.tipUpLv=Util.GetGameObject(self.gameObject,"upLv/tip")
this.noUpLvText=Util.GetGameObject(self.gameObject,"noUpLvText")
this.gongmingText=Util.GetGameObject(self.gameObject,"gongmingText")
Util.GetGameObject(this.gongmingText,"Image"):GetComponent("Image").sprite = this.spLoader:LoadSprite("h_hongmengbei_gongmingzhong_zh")
this.upLv=Util.GetGameObject(self.gameObject,"upLv")
this.lvUpGo=Util.GetGameObject(self.gameObject,"lvUpGo")
this.lvUpGoImage=Util.GetGameObject(self.gameObject,"lvUpGo/Image")
for i = 1, 5 do
lvUpShowProList[i]=Util.GetGameObject(this.lvUpGo.transform,"proPreParent/proPre"..i)
end
lvUpShowProList[5]:SetActive(false)
end
function RoleInfoLayout:OnPointerUp(Pointgo,data)--抬起
if self.isPressed then
self.isPressed = false
self:RefreshBottom(true)
end
end
--点击或长按处理升级处理
function RoleInfoLayout:OnPointerDown(Pointgo,data)--按下
self.isPressed = true
end
--绑定事件(用于子类重写)
function RoleInfoLayout:BindEvent()
--升级
Util.AddClick(this.upLvBtn, function()
if this.isGongMing then
PopupTipPanel.ShowTip("神将正在共鸣中,无法升级!")
return
end
if Time.realtimeSinceStartup - RoleInfoLayout.timePressStarted <= 0.4 then
this:LvUpClick(true)
end
end)
--长按升级按下状态
this._onPointerDown = function(Pointgo, data)
if this.isGongMing then
return
end
isTriggerLongClick = false
_isClicked = true
RoleInfoLayout.timePressStarted = Time.realtimeSinceStartup
oldLv = curHeroData.lv
this.isPressed = true
end
--长按升级抬起状态
this._onPointerUp = function(Pointgo, data)
if this.isGongMing then
PopupTipPanel.ShowTip("神将正在共鸣中,无法升级!")
return
end
if _isLongPress and isTriggerLongClick then
--连续升级抬起请求升级
this:LongLvUpClick(oldLv)
end
_isClicked = false
_isLongPress = false
this.isPressed = false
end
this.upLvTrigger.onPointerDown = this.upLvTrigger.onPointerDown + this._onPointerDown
this.upLvTrigger.onPointerUp = this.upLvTrigger.onPointerUp + this._onPointerUp
--显示所有属性
Util.AddClick(this.allProButton, function()
UIManager.OpenPanel(UIName.RoleProInfoPopup,allAddProVal,curHeroData.heroConfig,true,nil)
end)
end
--添加事件监听(用于子类重写)
function RoleInfoLayout:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, this.UpdateHeroUpLvAndBreakMaterialShow)
end
--移除事件监听(用于子类重写)
function RoleInfoLayout:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold,this.UpdateHeroUpLvAndBreakMaterialShow)
end
function RoleInfoLayout:OnShow()
self.gameObject:SetActive(true)
FixedUpdateBeat:Add(this.OnUpdate, self)--长按方法注册
end
function RoleInfoLayout:SetData(_sortinglayer,_parent,_curHerodata,_isUpZhen,_heroDatas)
this.sortingOrder = _sortinglayer
curHeroData = _curHerodata
parent = _parent
isUpZhen = _isUpZhen
herodatas = _heroDatas
this:UpdateHeroInfoData()
this:GetCurHeroUpLvOrUpStarSData()
this:UpdateHeroUpLvAndBreakData()--升级
end
--更新英雄情报数据
function this:UpdateHeroInfoData()
curTuPoRankUpConfig = heroRankupConfig[curHeroData.breakId]
curStarRankUpConfig = heroRankupConfig[curHeroData.upStarId]
local EquipSignUnlock = ConfigManager.GetConfigData(ConfigName.GameSetting,1).EquipSignUnlock
--动态品阶
local pId=0 --当前突破的阶数
if curHeroData.breakId~=0 then
pId= heroRankupConfig[curHeroData.breakId].Phase[2]
end
local hruConfig= ConfigManager.GetAllConfigsDataByDoubleKey(ConfigName.HeroRankupConfig,"Star",curHeroData.heroConfig.Star,"Show",1) --动态获取不同英雄最大突破等阶
for i = 1, #hruConfig do --动态生成
local item=this.pinjieList[i]
if not item then
item= newObjToParent(this.pinjiePre,this.pinjieRoot)
item.name="Pre"..i
this.pinjieList[i]=item
end
this.pinjieList[i]:GetComponent("Image").sprite=this.spLoader:LoadSprite(i<=pId and pinjieImage[2] or pinjieImage[1])
end
for n = 0, this.pinjieRoot.transform.childCount-1 do --超过品阶关闭显示
this.pinjieRoot.transform:GetChild(n).gameObject:SetActive(n+1<=#hruConfig)
end
--计算面板属性
local WarPower
if isUpZhen then
allAddProVal = HeroPropManager.GetHeroProp(curHeroData.dynamicId, FormationTypeDef.FORMATION_NORMAL)
WarPower = HeroPowerManager.GetHeroPower(curHeroData.dynamicId, FormationTypeDef.FORMATION_NORMAL)
else
allAddProVal = HeroPropManager.GetHeroProp(curHeroData.dynamicId)
WarPower = HeroPowerManager.GetHeroPower(curHeroData.dynamicId)
end
--因为后端无法区分是否为PVP所以前端处理把PVP伤害加成和减免从伤害加成和减免中去除
-- allAddProVal = HeroManager.CalculatePvpBonusForShow(allAddProVal)
this:ProShow(this.atkPro,allAddProVal,HeroProType.Attack)
this:ProShow(this.hpPro,allAddProVal,HeroProType.Hp)
this:ProShow(this.phyDef,allAddProVal,HeroProType.PhysicalDefence)
this:ProShow(this.magDef,allAddProVal,HeroProType.MagicDefence)
local curLvEnd = 30
if curHeroData.breakId > 0 then
curLvEnd = heroRankupConfig[curHeroData.breakId].OpenLevel
end
if curHeroData.upStarId > 0 then
if heroRankupConfig[curHeroData.upStarId].OpenLevel > curLvEnd then
curLvEnd = heroRankupConfig[curHeroData.upStarId].OpenLevel
end
end
if HarmonyManager.IsChangeColor(curHeroData.dynamicId) then
-- body#FFCC00
this.lv.text= "<color=green>"..curHeroData.lv.."</color>"
elseif HarmonyManager:IsEnvoy(curHeroData.dynamicId) and HarmonyManager:HongMengTowerUpLimit() >= HarmonyManager.TowerStartLimit then
this.lv.text= "<color=#FFCC00>"..curHeroData.lv.."</color>"
else
-- body
this.lv.text= curHeroData.lv.."/"..curLvEnd
end
--技能点击特殊处理
this.selsectSkillImage:SetActive(false)
this.baseAttri.alignment = GetCurLanguage() ~= 2 and "MiddleCenter" or "MiddleRight"
this.UpdateHeroUpStarProUpSkillShow(this.skillGrid,curHeroData.skillIdList,curHeroData.passiveSkillList)
end
function this:ProShow(go,allAddProVal,HeroProType,nextallAddProVal)
local curProSConFig = ConfigManager.GetConfigData(ConfigName.PropertyConfig,HeroProType)
Util.GetGameObject(go,"proName"):GetComponent("Text").text = GetLanguageStrById(curProSConFig.Info)..""
Util.GetGameObject(go,"proValue"):GetComponent("Text").text = allAddProVal[HeroProType]
Util.GetGameObject(go,"Image"):GetComponent("Image").sprite = this.spLoader:LoadSprite(PropertyTypeIconDef[HeroProType])
if nextallAddProVal then
Util.GetGameObject(go,"nextproValue"):GetComponent("Text").text = nextallAddProVal[HeroProType]
end
end
--更新英雄升级 和 突破 的材料显示
function this:UpdateHeroUpLvAndBreakMaterialShow()
if isHeroUpTuPo and upTuPoRankUpConfig and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then
costItemList=upTuPoRankUpConfig.ConsumeMaterial
else
costItemList=ConfigManager.GetConfigData(ConfigName.HeroLevelConfig, curHeroData.lv).Consume
end
if curHeroData.lv>=HeroManager.heroLvEnd[curHeroData.heroConfig.Id] then
this.noUpLvText:SetActive(true)
this.upLv:SetActive(false)
-- this.upLvBtn:SetActive(false)
--移除没有隐私是为了按钮抬起检测 不能隐藏 注意哦
this.upLvBtn:GetComponent("RectTransform").anchoredPosition = Vector2.New(2098, -42.00134 )
else
Util.ClearChild(this.itemGrid.transform)
this.noUpLvText:SetActive(false)
this.upLv:SetActive(true)
-- this.upLvBtn:SetActive(true)
this.upLvBtn:GetComponent("RectTransform").anchoredPosition = Vector2.New(322.3, -90)
isUpLvMaterials=true
for i = 1, #costItemList do
if costItemList[i][1]~=14 then
local go=newObject(this.itemPre)
go.transform:SetParent(this.itemGrid.transform)
go.transform.localScale = Vector3.one
go.transform.localPosition=Vector3.zero;
go:SetActive(true)
--Log("costItemList[i][1] "..costItemList[i][1])
if BagManager.GetItemCountById(costItemList[i][1])<costItemList[i][2] then
isUpLvMaterials=false
go.transform:Find("Image").gameObject:SetActive(true)--显示加号
Util.GetGameObject(go.transform,"Text"):GetComponent("Text").text=string.format("<color=#FF0000FF>%s/%s</color>",PrintWanNum2(BagManager.GetItemCountById(costItemList[i][1])),PrintWanNum2(costItemList[i][2]))
else
go.transform:Find("Image").gameObject:SetActive(false)--隐藏加号
Util.GetGameObject(go.transform,"Text"):GetComponent("Text").text=string.format("<color=#FFFFFFFF>%s/%s</color>",PrintWanNum2(BagManager.GetItemCountById(costItemList[i][1])),PrintWanNum2(costItemList[i][2]))
end
Util.GetGameObject(go.transform, "icon"):GetComponent("Image").sprite = this.spLoader:LoadSprite(GetResourcePath(itemConfig[costItemList[i][1]].ResourceID))
go.transform:GetComponent("Image").sprite = this.spLoader:LoadSprite(GetQuantityImageByquality(itemConfig[costItemList[i][1]].Quantity))
Util.AddOnceClick(Util.GetGameObject(go.transform,"icon"),function ()
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,costItemList[i][1])
end)
else
if BagManager.GetItemCountById(costItemList[i][1])<costItemList[i][2] then
isUpLvMaterials=false
this.upLvGoldText.text=string.format("<color=#FF0000FF>%s</color>",costItemList[i][2])
else
this.upLvGoldText.text=string.format("<color=#FFFFFFFF>%s</color>",costItemList[i][2])
end
Util.AddOnceClick(this.upLvGoldBtn,function()
UIManager.OpenPanel(UIName.RewardItemSingleShowPopup,costItemList[i][1])
end)
end
end
end
this.isGongMing = HarmonyManager.IsGongMing(curHeroData)
if this.isGongMing then
this.gongmingText:SetActive(true)
this.upLv:SetActive(false)
-- this.upLvBtn:SetActive(false)
this.noUpLvText:SetActive(false)
this.upLvBtn:GetComponent("RectTransform").anchoredPosition = Vector2.New(2098, -42.00134 )
return
else
this.gongmingText:SetActive(false)
end
--红点检测
local upLvRedpoint = HeroManager.LvUpBtnRedPoint(curHeroData)
this.upLvBtnRedPoint:SetActive(upLvRedpoint)
parent:CheckRedPointType(1,upLvRedpoint)
end
--单个技能显示
function this.UpdateHeroUpStarProUpSkillShow(skillGridGO,skillTabs,passiveSkills)
skillGridGO:GetComponent("Canvas").sortingOrder = this.sortingOrder + 1
local triggerCallBack
for i = 1, skillGridGO.transform.childCount do
local go= skillGridGO.transform:GetChild(i-1).gameObject
local skillType = Util.GetGameObject(go.transform,"skillType")
if #skillTabs>=i then--(#passiveSkills+#skillTabs)>=i then
local curSkillData = skillTabs[i]
if curSkillData and curSkillData.skillConfig and curSkillData.skillConfig.Name then
go:SetActive(true)
local skillTypeImage = Util.GetGameObject(go.transform,"skillImage/Image"):GetComponent("Image")
--if skillType then
if curSkillData.skillConfig.Type == SkillType.Pu then
--skillType:GetComponent("Text").text=SkillTypeStr[SkillType.Pu]
skillTypeImage.sprite=this.spLoader:LoadSprite(SkillIconType[SkillType.Pu])--普技
elseif curSkillData.skillConfig.Type == SkillType.Jue then
--skillType:GetComponent("Text").text=SkillTypeStr[SkillType.Jue]
skillTypeImage.sprite=this.spLoader:LoadSprite(SkillIconType[SkillType.Jue])--绝技
elseif curSkillData.skillConfig.Type == SkillType.Bei then
--skillType:GetComponent("Text").text=SkillTypeStr[SkillType.Bei]
skillTypeImage.sprite=this.spLoader:LoadSprite(SkillIconType[SkillType.Bei])--被动技
end
--end
local upGo = Util.GetGameObject(go.transform,"up")
if upGo then
if curSkillData.isShowUpImage ~= nil and curSkillData.isShowUpImage == false then
upGo:SetActive(false)
else
upGo:SetActive(true)
end
end
Util.GetGameObject(go.transform,"icon"):GetComponent("Image").sprite=this.spLoader:LoadSprite(GetResourcePath(curSkillData.skillConfig.Icon))--"i_act_ygmd2_2")
if GetCurLanguage() ~= 0 and LengthString(GetLanguageStrById(curSkillData.skillConfig.Name)) > 10 then
Util.GetGameObject(go.transform,"skillImage/skillName"):GetComponent("Text").text = SubString(GetLanguageStrById(curSkillData.skillConfig.Name),10).."..."
else
Util.GetGameObject(go.transform,"skillImage/skillName"):GetComponent("Text").text= GetLanguageStrById(curSkillData.skillConfig.Name)--(curSkillData.skillId % 10)
end
else
go:SetActive(false)
end
Util.AddOnceClick(Util.GetGameObject(go.transform,"icon"), function()
if Game.GlobalEvent:HasEvent(GameEvent.UI.OnClose, triggerCallBack) then
Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, triggerCallBack)
end
this.selsectSkillImage:SetActive(true)
this.selsectSkillImage.transform.position=Util.GetGameObject(go.transform,"icon").transform.position
local maxLv= HeroManager.GetHeroSkillMaxLevel(curHeroData.heroConfig.Id,curSkillData.skillConfig.Type)
local panel = UIManager.OpenPanel(UIName.SkillInfoPopup,curSkillData,1,10,maxLv,i)
skillGridGO:GetComponent("Canvas").sortingOrder = panel.sortingOrder + 1
triggerCallBack = function (panelType, p)
if panelType == UIName.SkillInfoPopup and panel == p then --监听到SkillInfoPopup关闭把层级设回去
skillGridGO:GetComponent("Canvas").sortingOrder = this.sortingOrder + 1
Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnClose, triggerCallBack)
this.selsectSkillImage:SetActive(false)
end
end
Game.GlobalEvent:AddEvent(GameEvent.UI.OnClose, triggerCallBack)
end)
else
go:SetActive(false)
end
end
end
--获取当前英雄的下一突破 和 升星 静态数据
function RoleInfoLayout:GetCurHeroUpLvOrUpStarSData()
isHeroUpTuPo = false
isHeroUpStar = false
upTuPoRankUpConfig = {}
upStarRankUpConfig = {}
local heroRankUpConfig = ConfigManager.GetConfig(ConfigName.HeroRankupConfig)
for i, v in ConfigPairs(heroRankUpConfig) do
if v.Star==curHeroData.heroConfig.Star then--初始星级相等
if v.Show==1 then -- 1 突破
if v.Id ~= curHeroData.breakId and curHeroData.lv == v.LimitLevel then--and curHeroData.star == v.LimitStar
--Log("突破 "..v.Id)
isHeroUpTuPo = true
upTuPoRankUpConfig = v
end
end
if v.Show==2 then -- 2 升星
if v.Id ~= curHeroData.upStarId and curHeroData.star == v.LimitStar then
--Log("升星 "..v.Id)
upStarRankUpConfig=v
isHeroUpStar=true
end
end
end
end
end
--更新英雄升级 和 突破数据
function this:UpdateHeroUpLvAndBreakData()
-- 升级获取突破 和 升星相应heroRankUpConfig静态数据
-- LogError("curHeroData "..curHeroData.breakId)
if isHeroUpTuPo and upTuPoRankUpConfig and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then
this.tipUpLv:GetComponent("Text").text=Language[11804]
this.tipUpLv:SetActive(true)
this.upLvBtnText.text=Language[11805]
this.upLvBtnImage.sprite = this.spLoader:LoadSprite("r_hero_button_001")--r_chouka_button_004
this.upLvBtnTiShiText.text=Language[11806]
_isClicked = false
_isReqLvUp = false
else
if curHeroData.lv < 30 then--策划规定三十级之前一直显示持续长按可快速升级
this.tipUpLv:SetActive(true)
this.tipUpLv:GetComponent("Text").text = Language[11807]
else
this.tipUpLv:SetActive(false)
end
this.upLvBtnText.text=Language[11063]
this.upLvBtnImage.sprite = this.spLoader:LoadSprite("r_hero_button_002")
this.upLvBtnTiShiText.text=Language[11434]
if isHeroUpStar and upStarRankUpConfig and curTuPoRankUpConfig and curTuPoRankUpConfig.JudgeClass==1 and curHeroData.lv >= curTuPoRankUpConfig.OpenLevel then--当前突破全部完成
if curStarRankUpConfig then--进阶过处理
if curHeroData.lv == curStarRankUpConfig.OpenLevel then
this.tipUpLv:GetComponent("Text").text=Language[11804]
this.tipUpLv:SetActive(true)
end
else--从未进阶过处理
this.tipUpLv:GetComponent("Text").text=Language[11804]
this.tipUpLv:SetActive(true)
end
end
end
this:UpdateHeroUpLvAndBreakMaterialShow()
end
function RoleInfoLayout:OnSortingOrderChange()
end
--升级按钮点击事件处理
function RoleInfoLayout:LvUpClick(isSingleLvUp)
--是否为最大等级
-- --LogGreen("isSingleLvUp "..tostring(isSingleLvUp))
if curHeroData.lv>=HeroManager.heroLvEnd[curHeroData.heroConfig.Id] then
PopupTipPanel.ShowTip(Language[11788])
_isClicked = false
_isReqLvUp = false
return
end
--如果此时需要进阶 每次都要跳转
if isHeroUpStar and upStarRankUpConfig and curTuPoRankUpConfig and curTuPoRankUpConfig.JudgeClass==1 and curHeroData.lv >= curTuPoRankUpConfig.OpenLevel then--当前突破全部完成
if curStarRankUpConfig then--进阶过处理
if curHeroData.lv == curStarRankUpConfig.OpenLevel then
if curHeroData.star >= curHeroData.heroConfig.MaxRank then
MsgPanel.ShowOne("当前神将已达最大星级")
return
end
_isClicked = false
_isReqLvUp = false
local showTipStr = Language[11808]
local showIndex = 2
local showBtnTipStr = Language[11809]
if curHeroData.star == HeroManager.awakeStarIndex then
showTipStr = Language[11810]
showBtnTipStr = Language[11811]
showIndex = 3
end
if showIndex == 3 then
if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.RoleAwake) then
MsgPanel.ShowTwo(showTipStr, nil, function()
parent:SetSelectBtn(showIndex)
parent:OnPageTabChange(showIndex)
end,Language[10731],showBtnTipStr)
else
PopupTipPanel.ShowTip(Language[11812])--需要先进行觉醒!
end
else
MsgPanel.ShowTwo(showTipStr, nil, function()
parent:SetSelectBtn(showIndex)
parent:OnPageTabChange(showIndex)
end,Language[10731],showBtnTipStr)
end
else
if isUpLvMaterials then
if isSingleLvUp then--是否是单次升级
NetManager.HeroLvUpEvent(curHeroData.dynamicId,curHeroData.lv + 1,curHeroData.lv,function (msg)
this:DeleteLvUpMaterials(isSingleLvUp,msg)
end)
else
isTriggerLongClick = true
this:DeleteLvUpMaterials(isSingleLvUp)
end
else
_isClicked = false
_isReqLvUp = false
if isHeroUpTuPo and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then
PopupTipPanel.ShowTip(Language[11813])
else
PopupTipPanel.ShowTip(Language[11814])
end
end
end
else--从未进阶过处理
_isClicked = false
_isReqLvUp = false
MsgPanel.ShowTwo(Language[11808], nil, function()
parent:SetSelectBtn(2)
parent:OnPageTabChange(2)
end,Language[10731],Language[11809])
end
else
if isUpLvMaterials then
if isSingleLvUp then--是否是单次升级
local curUpLv = curHeroData.lv
if isHeroUpTuPo and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then
curUpLv = curHeroData.lv
else
curUpLv = curHeroData.lv + 1
end
NetManager.HeroLvUpEvent(curHeroData.dynamicId,curUpLv,curHeroData.lv,function (msg)
this:DeleteLvUpMaterials(isSingleLvUp,msg)
end)
else
isTriggerLongClick = true
this:DeleteLvUpMaterials(isSingleLvUp)
end
else
_isClicked = false
_isReqLvUp = false
if isHeroUpTuPo and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then
PopupTipPanel.ShowTip(Language[11813])
else
PopupTipPanel.ShowTip(Language[11814])
end
end
end
end
--长按升级结束后请求协议
function RoleInfoLayout:LongLvUpClick(oldLv)
NetManager.HeroLvUpEvent(curHeroData.dynamicId,curHeroData.lv,oldLv,function (msg)
this:DeleteLvUpMaterials2(msg)
end)
end
--扣除升级 突破 消耗的材料 更新英雄数据
function RoleInfoLayout:DeleteLvUpMaterials(isSingleLvUp,msg)
if isSingleLvUp == false then--连续升级的时候需要自己先扣除
for i = 1, #costItemList do
--Log(string.format("扣除id=%s 数量=%s",costItemList[i][1],costItemList[i][2]))
BagManager.HeroLvUpUpdateItemsNum(costItemList[i][1],costItemList[i][2])
end
end
-- for i, v in pairs(heroDatas) do
-- if curHeroData == v then
if isHeroUpTuPo and upTuPoRankUpConfig and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then
UIManager.OpenPanel(UIName.RoleUpLvBreakSuccessPanel,curHeroData,upTuPoRankUpConfig.Id,upTuPoRankUpConfig.OpenLevel)
curHeroData.breakId=upTuPoRankUpConfig.Id
curHeroData.breakId=curHeroData.breakId
--突破有可能会升星
if curHeroData.star<upTuPoRankUpConfig.OpenStar then
curHeroData.star=upTuPoRankUpConfig.OpenStar
curHeroData.star=curHeroData.star
end
_isClicked = false
_isReqLvUp = false
else
if msg then
curHeroData.lv=msg.targetLevel
-- Log("后端更新猎妖师技术前端刷新界面targetLevel "..msg.targetLevel)
else
curHeroData.lv=curHeroData.lv + 1
-- Log("后端更新猎妖师技术前端刷新界面curHeroData.lv "..curHeroData.lv)
end
-- curHeroData.lv=curHeroData.lv
-- PopupTipPanel.ShowTip("升级成功!")
PopupTipPanel.ShowTip(Language[11867])
end
-- end
-- end
--Log("刷新英雄库里单个英雄数据 "..curHeroData.dynamicId.." "..curHeroData.lv.." "..curHeroData.star.." "..curHeroData.breakId.." "..curHeroData.upStarId)
--刷新英雄库里单个英雄数据
if isHeroUpTuPo and upTuPoRankUpConfig and curHeroData.lv == upTuPoRankUpConfig.LimitLevel then
this.lvUpGoImage:SetActive(false)
-- 突破音效
PlaySoundWithoutClick(SoundConfig.Sound_Breach)
else
this.lvUpGoImage:SetActive(true)
-- 升级音效
PlaySoundWithoutClick(SoundConfig.Sound_Upgrade)
end
if msg then
HeroManager.UpdateSingleHeroDatas(curHeroData.dynamicId,msg.targetLevel,curHeroData.star,curHeroData.breakId,curHeroData.upStarId,isSingleLvUp)
else
HeroManager.UpdateSingleHeroDatas(curHeroData.dynamicId,curHeroData.lv,curHeroData.star,curHeroData.breakId,curHeroData.upStarId,isSingleLvUp)
end
local allAddProValOld = allAddProVal
parent:UpdateHeroInfoData()--刷新界面
this.ShowProAddVal(allAddProValOld)
if isSingleLvUp then
parent.upLvEffect:SetActive(false)
parent.upLvEffect:SetActive(true)
end
-- _isReqLvUp = false
Timer.New(function()
_isReqLvUp = false
end, 0.1):Start()
end
--连续升级更新后端英雄数据
function RoleInfoLayout:DeleteLvUpMaterials2(msg)
for i, v in pairs(herodatas) do
if curHeroData == v then
if msg then
curHeroData.lv=msg.targetLevel
-- Log("后端更新猎妖师技术前端刷新界面 "..msg.targetLevel)
end
v.lv=curHeroData.lv
end
end
if msg then
HeroManager.UpdateSingleHeroDatas(curHeroData.dynamicId,msg.targetLevel,curHeroData.star,curHeroData.breakId,curHeroData.upStarId,true)
else
HeroManager.UpdateSingleHeroDatas(curHeroData.dynamicId,curHeroData.lv,curHeroData.star,curHeroData.breakId,curHeroData.upStarId,true)
end
parent:UpdateHeroInfoData()--刷新界面
parent.upLvEffect:SetActive(false)
parent.upLvEffect:SetActive(true)
end
--长按升级处理
function this.OnUpdate()
if _isClicked then
if Time.realtimeSinceStartup - RoleInfoLayout.timePressStarted > 0.4 then
_isLongPress = true
if not _isReqLvUp then
_isReqLvUp = true
this:LvUpClick(false)
end
end
end
end
--播放升级 属性提升动画
function this.ShowProAddVal(allAddProValOld)
this.lvUpGo:SetActive(true)
Util.GetGameObject(lvUpShowProList[1], "proPre/vale"):GetComponent("Text").text="+"..allAddProVal[HeroProType.Attack]-allAddProValOld[HeroProType.Attack]
Util.GetGameObject(lvUpShowProList[2], "proPre/vale"):GetComponent("Text").text="+"..allAddProVal[HeroProType.Hp]-allAddProValOld[HeroProType.Hp]
Util.GetGameObject(lvUpShowProList[3], "proPre/vale"):GetComponent("Text").text="+"..allAddProVal[HeroProType.PhysicalDefence]-allAddProValOld[HeroProType.PhysicalDefence]
Util.GetGameObject(lvUpShowProList[4], "proPre/vale"):GetComponent("Text").text="+"..allAddProVal[HeroProType.MagicDefence]-allAddProValOld[HeroProType.MagicDefence]
--Util.GetGameObject(lvUpShowProList[5], "proPre/vale"):GetComponent("Text").text="+"..allAddProVal[HeroProType.Speed]-allAddProValOld[HeroProType.Speed]
this.ThreadShowProAddVal()
end
function this.ThreadShowProAddVal()
if this.priThread then
coroutine.stop(this.priThread)
this.priThread = nil
end
table.walk(lvUpShowProList, function(privilegeItem)
privilegeItem:SetActive(false)
end)
this.priThread = coroutine.start(function()
for i = 1, 4 do
lvUpShowProList[i]:SetActive(false)
PlayUIAnims(lvUpShowProList[i])
coroutine.wait(0.04)
lvUpShowProList[i]:SetActive(true)
coroutine.wait(0.08)
end
this.lvUpGo:SetActive(false)
end)
end
function RoleInfoLayout:OnHide()
self.gameObject:SetActive(false)
end
function RoleInfoLayout:OnClose()
FixedUpdateBeat:Remove(this.OnUpdate, self)
if this.priThread then
coroutine.stop(this.priThread)
-- 关闭显示
for i = 1, 4 do
lvUpShowProList[i]:SetActive(false)
end
this.lvUpGo:SetActive(false)
this.priThread = nil
end
this.pinjieList={}
end
return RoleInfoLayout

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 1519eafcc56809b4dafa98840e510eec
timeCreated: 1545907222
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -7,14 +7,25 @@ local tabsList = {}
local tabs = {
[1] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = Language[11093],rpType = -1,
},
[2] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = Language[11815],rpType = -1,
[2] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = "神魂",rpType = -1,
},
[3] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = Language[10373],rpType = -1,
[3] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = Language[11815],rpType = -1,
},
[4] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = Language[11095],rpType = -1,
[4] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = Language[10373],rpType = -1,
},
[5] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = Language[11816],rpType = -1,
[5] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = Language[11095],rpType = -1,
},
[6] = {default = "r_hero_xuanze_002", lock = "r_hero_xuanze_002", select = "r_hero_xuanze_001",title = Language[11816],rpType = -1,
},
}
local tabPage = {
[1] = SubUIConfig.RoleInfoLayout,
[2] = SubUIConfig.RoleGodSoulLayout,
[3] = SubUIConfig.RoleUpStarLayout,
[4] = SubUIConfig.RoleAwakelayout,
[5] = SubUIConfig.RoleStoryLayout,
[6] = SubUIConfig.RoleSkinLayout,
}
local curHeroData--当前英雄信息
@ -506,13 +517,7 @@ function this:SetSelectBtn(index)
end
end
local tabPage = {
[1] = SubUIConfig.RoleInfoLayout,
[2] = SubUIConfig.RoleUpStarLayout,
[3] = SubUIConfig.RoleAwakelayout,
[4] = SubUIConfig.RoleStoryLayout,
[5] = SubUIConfig.RoleSkinLayout,
}
-- tab改变事件
function this:OnPageTabChange(index)