Merge branch 'china/dev' into 0活动开发聚集地/福星高照

dev_chengFeng
ZhangBiao 2021-03-30 20:21:32 +08:00
commit 62a064b33e
14 changed files with 6006 additions and 32722 deletions

View File

@ -5844,6 +5844,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 1410886060457754308} - {fileID: 1410886060457754308}
- {fileID: 5801319164494139603}
m_Father: {fileID: 6847745749794772469} m_Father: {fileID: 6847745749794772469}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -6146,7 +6147,6 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 2844167576605455372} - {fileID: 2844167576605455372}
- {fileID: 5801319164494139603}
m_Father: {fileID: 6855514544870948464} m_Father: {fileID: 6855514544870948464}
m_RootOrder: 4 m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -6559,11 +6559,11 @@ RectTransform:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8488004882552802164} m_GameObject: {fileID: 8488004882552802164}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 6847745749794772469} m_Father: {fileID: 2844167576605455372}
m_RootOrder: 1 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}

File diff suppressed because it is too large Load Diff

View File

@ -136,22 +136,10 @@ function CarbonTypePanelV2:InitComponent()
this.zonghe = Util.GetGameObject(self.gameObject, "BgRoot/GameObject") this.zonghe = Util.GetGameObject(self.gameObject, "BgRoot/GameObject")
this.backBtn = Util.GetGameObject(self.gameObject, "backBtn") this.backBtn = Util.GetGameObject(self.gameObject, "backBtn")
--头像、战力
this.level = Util.GetGameObject(this.zonghe, "LeftUp/headBox/lvFrame/lv"):GetComponent("Text")
this.playName = Util.GetGameObject(this.zonghe, "LeftUp/headBox/name"):GetComponent("Text")
this.expSliderValue = Util.GetGameObject(this.zonghe, "LeftUp/headBox/exp"):GetComponent("Slider")
this.expSliderValue.transform.localScale = Vector3.New(UIManager.adapterScale, 1, 1)
this.headBox = Util.GetGameObject(this.zonghe, "LeftUp/headBox") if not this.playerInfoView then
this.headPos = Util.GetGameObject(this.zonghe, "LeftUp/headBox/headpos") this.playerInfoView = SubUIManager.Open(SubUIConfig.PlayerInfoView, this.zonghe.transform)
this.headRedpot = Util.GetGameObject(this.zonghe, "LeftUp/headBox/redpot") end
this.teamPower = Util.GetGameObject(this.zonghe, "LeftUp/powerBtn/value"):GetComponent("Text")
-- 特权
this.vipPrivilegeBtn = Util.GetGameObject(this.zonghe, "LeftUp/vipPrivilege/vipPrivilegeBtn")
this.vipLevelText = Util.GetGameObject(this.vipPrivilegeBtn, "bg/vip"):GetComponent("Image")
this.vipRedPoint = Util.GetGameObject(this.zonghe, "LeftUp/vipPrivilege/redPoint")
screenAdapte(this.vipPrivilegeBtn)
this.AnimRoot = Util.GetGameObject(self.gameObject, "btnRoot/circle/root") this.AnimRoot = Util.GetGameObject(self.gameObject, "btnRoot/circle/root")
@ -164,7 +152,6 @@ end
local index = 1 local index = 1
--绑定事件(用于子类重写) --绑定事件(用于子类重写)
function CarbonTypePanelV2:BindEvent() function CarbonTypePanelV2:BindEvent()
BindRedPointObject(RedPointType.VipPrivilege, this.vipRedPoint)
Util.AddClick( Util.AddClick(
this.backBtn, this.backBtn,
function() function()
@ -173,22 +160,6 @@ function CarbonTypePanelV2:BindEvent()
end end
) )
-- 点击你的猪头
Util.AddClick(
this.headBox,
function()
UIManager.OpenPanel(UIName.SettingPanel)
end
)
BindRedPointObject(RedPointType.Setting, this.headRedpot)
Util.AddClick(
this.vipPrivilegeBtn,
function()
UIManager.OpenPanel(UIName.VipPanelV2)
end
)
end end
--添加事件监听(用于子类重写) --添加事件监听(用于子类重写)
@ -260,16 +231,12 @@ function CarbonTypePanelV2:OnShow(...)
if carbonType == 1 then if carbonType == 1 then
this.zonghe.gameObject:SetActive(true) this.zonghe.gameObject:SetActive(true)
this.backBtn.gameObject:SetActive(false) this.backBtn.gameObject:SetActive(false)
this.FreshPlayerInfo()
this.SetPlayerHead()
elseif carbonType == 2 then elseif carbonType == 2 then
this.zonghe.gameObject:SetActive(false) this.zonghe.gameObject:SetActive(false)
this.backBtn.gameObject:SetActive(true) this.backBtn.gameObject:SetActive(true)
else else
this.zonghe.gameObject:SetActive(true) this.zonghe.gameObject:SetActive(true)
this.backBtn.gameObject:SetActive(false) this.backBtn.gameObject:SetActive(false)
this.FreshPlayerInfo()
this.SetPlayerHead()
end end
this.UpdateCarbonContent() this.UpdateCarbonContent()
@ -436,32 +403,9 @@ function this.BtnClick(id)
end end
-- 刷新玩家信息显示
function this.FreshPlayerInfo()
this.vipLevelText.sprite = VipManager.SetVipLevelImg()
this.level.text = PlayerManager.level
this.expSliderValue.value = PlayerManager.exp / PlayerManager.userLevelData[PlayerManager.level].Exp
this.playName.text = PlayerManager.nickName
this.teamPower.text = FormationManager.GetFormationPower(FormationManager.curFormationIndex)
end
-- 设置头像
function this.SetPlayerHead()
if not this.playerHead then
this.playerHead = SubUIManager.Open(SubUIConfig.PlayerHeadView, this.headPos.transform)
end
this.playerHead:SetHead(PlayerManager.head)
this.playerHead:SetFrame(HeadManager.GetCurFrameId())
this.playerHead:SetScale(Vector3.one * 0.9)
this.playerHead:SetPosition(Vector3.New(-5, 8, 0))
this.playerHead:SetLayer(this.sortingOrder)
this.playerHead:SetEffectScale(0.85)
end
function this:OnSortingOrderChange() function this:OnSortingOrderChange()
Util.AddParticleSortLayer(this.effect, self.sortingOrder - orginLayer) Util.AddParticleSortLayer(this.effect, self.sortingOrder - orginLayer)
Util.AddParticleSortLayer(this.wind, self.sortingOrder - orginLayer) Util.AddParticleSortLayer(this.wind, self.sortingOrder - orginLayer)
Util.AddParticleSortLayer(this.vipPrivilegeBtn, self.sortingOrder - orginLayer)
orginLayer = self.sortingOrder orginLayer = self.sortingOrder
if carbonType == 1 then if carbonType == 1 then
@ -472,8 +416,8 @@ function this:OnSortingOrderChange()
else else
end end
-- 头像层级 -- 头像层级
if this.playerHead then if this.playerInfoView then
this.playerHead:SetLayer(self.sortingOrder) this.playerInfoView:SetLayer(self.sortingOrder)
end end
end end
@ -528,16 +472,14 @@ function CarbonTypePanelV2:OnDestroy()
SubUIManager.Close(this.BtView) SubUIManager.Close(this.BtView)
end end
carbons = {} carbons = {}
if this.playerHead then if this.playerInfoView then
SubUIManager.Close(this.playerHead) SubUIManager.Close(this.playerInfoView)
this.playerInfoView = nil
end end
SubUIManager.Close(this.UpView) SubUIManager.Close(this.UpView)
this.playerHead = nil
this.UpView = nil this.UpView = nil
this.BtView = nil this.BtView = nil
ClearRedPointObject(RedPointType.Setting, this.headRedpot)
-- for k,v in ipairs(carbons) do -- for k,v in ipairs(carbons) do
-- local data -- local data
-- if not type[PlayerManager.carbonType][k] then -- if not type[PlayerManager.carbonType][k] then

View File

@ -60,16 +60,6 @@ function FightPointPassMainPanel:InitComponent()
fightMap:InitComponent(self.gameObject, this) fightMap:InitComponent(self.gameObject, this)
isAnimActive = false isAnimActive = false
--头像、战力
this.level = Util.GetGameObject(self.gameObject, "Bg/LeftUp/headBox/lvFrame/lv"):GetComponent("Text")
this.playName = Util.GetGameObject(self.gameObject, "Bg/LeftUp/headBox/name"):GetComponent("Text")
this.expSliderValue = Util.GetGameObject(self.gameObject, "Bg/LeftUp/headBox/exp"):GetComponent("Slider")
this.expSliderValue.transform.localScale = Vector3.New(UIManager.adapterScale, 1, 1)
this.headBox = Util.GetGameObject(self.gameObject, "Bg/LeftUp/headBox")
this.headPos = Util.GetGameObject(self.gameObject, "Bg/LeftUp/headBox/headpos")
this.headRedpot = Util.GetGameObject(self.gameObject, "Bg/LeftUp/headBox/redpot")
this.teamPower = Util.GetGameObject(self.gameObject, "Bg/LeftUp/powerBtn/value"):GetComponent("Text")
-- 通关豪礼入口 -- 通关豪礼入口
this.pgBtn=Util.GetGameObject(self.gameObject,"LeftUp/box/passGift") this.pgBtn=Util.GetGameObject(self.gameObject,"LeftUp/box/passGift")
this.pgFrame=Util.GetGameObject(this.pgBtn,"frame"):GetComponent("Image") this.pgFrame=Util.GetGameObject(this.pgBtn,"frame"):GetComponent("Image")
@ -112,6 +102,11 @@ function FightPointPassMainPanel:InitComponent()
LanguageFontSizeFilter(this.fightText, 50) LanguageFontSizeFilter(this.fightText, 50)
-- 你要变强 -- 你要变强
this.btnGetForce = Util.GetGameObject(self.gameObject, "Bg/btnDown/btnIWantMilk") this.btnGetForce = Util.GetGameObject(self.gameObject, "Bg/btnDown/btnIWantMilk")
if not this.playerInfoView then
this.playerInfoView = SubUIManager.Open(SubUIConfig.PlayerInfoView, this.transform)
end
this.BtView = SubUIManager.Open(SubUIConfig.BtView, self.gameObject.transform) this.BtView = SubUIManager.Open(SubUIConfig.BtView, self.gameObject.transform)
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform) this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform)
@ -217,12 +212,6 @@ function FightPointPassMainPanel:InitComponent()
this.openFunNeedInfo = Util.GetGameObject(self.gameObject, "Bg/RightUpVertical/openFun/needInfo"):GetComponent("Text") this.openFunNeedInfo = Util.GetGameObject(self.gameObject, "Bg/RightUpVertical/openFun/needInfo"):GetComponent("Text")
this.openFunFunInfo = Util.GetGameObject(self.gameObject, "Bg/RightUpVertical/openFun/funInfo"):GetComponent("Text") this.openFunFunInfo = Util.GetGameObject(self.gameObject, "Bg/RightUpVertical/openFun/funInfo"):GetComponent("Text")
-- 特权
this.vipPrivilegeBtn = Util.GetGameObject(self.gameObject, "Bg/LeftUp/vipPrivilege/vipPrivilegeBtn")
this.vipLevelText = Util.GetGameObject(this.vipPrivilegeBtn, "bg/vip"):GetComponent("Image")
this.vipRedPoint = Util.GetGameObject(self.gameObject, "Bg/LeftUp/vipPrivilege/redPoint")
screenAdapte(this.vipPrivilegeBtn)
-- 开服福利 -- 开服福利
this.UI_Effect_MuBiaoJiangLi = Util.GetGameObject(self.gameObject, "Bg/LeftUp/box/btnOpenSeverWelfare/UI_Effect_MuBiaoJiangLi") this.UI_Effect_MuBiaoJiangLi = Util.GetGameObject(self.gameObject, "Bg/LeftUp/box/btnOpenSeverWelfare/UI_Effect_MuBiaoJiangLi")
this.btnOpenSeverWelfare = Util.GetGameObject(self.gameObject, "Bg/LeftUp/box/btnOpenSeverWelfare") this.btnOpenSeverWelfare = Util.GetGameObject(self.gameObject, "Bg/LeftUp/box/btnOpenSeverWelfare")
@ -280,15 +269,6 @@ function FightPointPassMainPanel:BindEvent()
end end
end) end)
Util.AddClick(this.headBox, function ()
UIManager.OpenPanel(UIName.SettingPanel)
end)
--特权
Util.AddClick(this.vipPrivilegeBtn, function()
UIManager.OpenPanel(UIName.VipPanelV2)
end)
--通关豪礼 --通关豪礼
Util.AddClick(this.pgBtn,function() Util.AddClick(this.pgBtn,function()
FightPointPassManager.isBeginFight = true FightPointPassManager.isBeginFight = true
@ -306,16 +286,10 @@ function FightPointPassMainPanel:BindEvent()
Util.AddClick(this.btnXiaoYao,function() Util.AddClick(this.btnXiaoYao,function()
XiaoYaoManager.OpenMapList() XiaoYaoManager.OpenMapList()
end) end)
Util.AddClick(this.vipPrivilegeBtn, function()
UIManager.OpenPanel(UIName.VipPanelV2)
end)
Util.AddClick(this.btnOpenSeverWelfare, function() Util.AddClick(this.btnOpenSeverWelfare, function()
UIManager.OpenPanel(UIName.OpenSeverWelfarePanel) UIManager.OpenPanel(UIName.OpenSeverWelfarePanel)
end) end)
BindRedPointObject(RedPointType.DailyTaskMain, this.dailyRedPoint) BindRedPointObject(RedPointType.DailyTaskMain, this.dailyRedPoint)
BindRedPointObject(RedPointType.Setting, this.headRedpot)
BindRedPointObject(RedPointType.VipPrivilege, this.vipRedPoint)
BindRedPointObject(RedPointType.SecretTer_IsCanFight, this.fightRP) BindRedPointObject(RedPointType.SecretTer_IsCanFight, this.fightRP)
BindRedPointObject(RedPointType.XiaoYaoYouRedPoint, this.xiaoyaoRedPoint) BindRedPointObject(RedPointType.XiaoYaoYouRedPoint, this.xiaoyaoRedPoint)
end end
@ -347,7 +321,6 @@ function FightPointPassMainPanel:AddListener()
invadeMonster:AddListener() invadeMonster:AddListener()
fightMap:AddListener() fightMap:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Player.OnPlayerLvChange, this.FreshPlayerInfo)
Game.GlobalEvent:AddEvent(GameEvent.FunctionCtrl.OnFunctionOpen, this.BtnsIsOpen) Game.GlobalEvent:AddEvent(GameEvent.FunctionCtrl.OnFunctionOpen, this.BtnsIsOpen)
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, this.UpdateFindTreasureMaterialNum) Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, this.UpdateFindTreasureMaterialNum)
Game.GlobalEvent:AddEvent(GameEvent.FindTreasure.RefreshFindTreasureRedPot, this.RefreshFindTreasureRedPoint) Game.GlobalEvent:AddEvent(GameEvent.FindTreasure.RefreshFindTreasureRedPot, this.RefreshFindTreasureRedPoint)
@ -360,7 +333,6 @@ function FightPointPassMainPanel:RemoveListener()
invadeMonster:RemoveListener() invadeMonster:RemoveListener()
fightMap:RemoveListener() fightMap:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnPlayerLvChange, this.FreshPlayerInfo)
Game.GlobalEvent:RemoveEvent(GameEvent.FunctionCtrl.OnFunctionOpen, this.BtnsIsOpen) Game.GlobalEvent:RemoveEvent(GameEvent.FunctionCtrl.OnFunctionOpen, this.BtnsIsOpen)
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold, this.UpdateFindTreasureMaterialNum) Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold, this.UpdateFindTreasureMaterialNum)
Game.GlobalEvent:RemoveEvent(GameEvent.FindTreasure.RefreshFindTreasureRedPot, this.RefreshFindTre3asureRedPoint) Game.GlobalEvent:RemoveEvent(GameEvent.FindTreasure.RefreshFindTreasureRedPot, this.RefreshFindTre3asureRedPoint)
@ -411,8 +383,6 @@ function FightPointPassMainPanel:OnShow()
end end
this.chapterName.text = GetLanguageStrById(fightLevelSetConfig[chapterId].Name) this.chapterName.text = GetLanguageStrById(fightLevelSetConfig[chapterId].Name)
this.FreshPlayerInfo()
this.InitShow()
-- 奖励预览 -- 奖励预览
this.IntiReward() this.IntiReward()
@ -424,7 +394,6 @@ function FightPointPassMainPanel:OnShow()
hasLoad = true hasLoad = true
this:Update() this:Update()
this.FreshVip()
if callBack then if callBack then
callBack() callBack()
@ -495,11 +464,6 @@ function this:Update()
end end
end end
-- 刷新特权显示
function this.FreshVip()
this.vipLevelText.sprite = VipManager.SetVipLevelImg()
end
--按钮开启限制 --按钮开启限制
function this.BtnsIsOpen() function this.BtnsIsOpen()
for i, v in pairs(this.funcBtnList) do for i, v in pairs(this.funcBtnList) do
@ -509,20 +473,6 @@ function this.BtnsIsOpen()
this.btnRank.gameObject:SetActive(ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.ALLRANKING)) this.btnRank.gameObject:SetActive(ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.ALLRANKING))
end end
function this.InitShow()
if not this.playerHead then
this.playerHead = SubUIManager.Open(SubUIConfig.PlayerHeadView, this.headPos.transform)
end
this.playerHead:SetHead(PlayerManager.head)
this.playerHead:SetFrame(HeadManager.GetCurFrameId())
this.playerHead:SetScale(Vector3.one * 0.9)
this.playerHead:SetPosition(Vector3.New(-5, 8, 0))
this.playerHead:SetLayer(this.sortingOrder)
this.playerHead:SetEffectScale(0.85)
end
function this.IntiReward() function this.IntiReward()
local rewardData local rewardData
if FightPointPassManager.isOpenNewChapter then if FightPointPassManager.isOpenNewChapter then
@ -551,16 +501,6 @@ function this.IntiReward()
end end
end end
-- 刷新玩家信息显示
function this.FreshPlayerInfo()
this.level.text = PlayerManager.level
this.expSliderValue.value = PlayerManager.exp / PlayerManager.userLevelData[PlayerManager.level].Exp
this.playName.text = PlayerManager.nickName
this.teamPower.text = FormationManager.GetFormationPower(FormationManager.curFormationIndex)
this.SetFightBtnText()
end
--刷新通关豪礼主界面显示 --刷新通关豪礼主界面显示
function this.RefreshPassGiftShow() function this.RefreshPassGiftShow()
local mainLevelEndId=ConfigManager.TryGetConfigDataByKey(ConfigName.MainLevelConfig,"NextLevel",-1).Id--最高关卡 local mainLevelEndId=ConfigManager.TryGetConfigDataByKey(ConfigName.MainLevelConfig,"NextLevel",-1).Id--最高关卡
@ -646,7 +586,6 @@ function FightPointPassMainPanel:OnSortingOrderChange()
Util.AddParticleSortLayer(this.GuideEffectGo, self.sortingOrder - orginLayer) Util.AddParticleSortLayer(this.GuideEffectGo, self.sortingOrder - orginLayer)
Util.AddParticleSortLayer(this.GuideJumpEffectGo, self.sortingOrder - orginLayer) Util.AddParticleSortLayer(this.GuideJumpEffectGo, self.sortingOrder - orginLayer)
Util.AddParticleSortLayer(this.pgEffect, self.sortingOrder - orginLayer) Util.AddParticleSortLayer(this.pgEffect, self.sortingOrder - orginLayer)
Util.AddParticleSortLayer(this.vipPrivilegeBtn, self.sortingOrder - orginLayer)
Util.AddParticleSortLayer(this.UI_Effect_MuBiaoJiangLi, self.sortingOrder - orginLayer) Util.AddParticleSortLayer(this.UI_Effect_MuBiaoJiangLi, self.sortingOrder - orginLayer)
fightMap:OnSortingOrderChange(self.sortingOrder) fightMap:OnSortingOrderChange(self.sortingOrder)
@ -654,8 +593,8 @@ function FightPointPassMainPanel:OnSortingOrderChange()
this.BtView:SetOrderStatus({ sortOrder = self.sortingOrder }) this.BtView:SetOrderStatus({ sortOrder = self.sortingOrder })
-- 头像层级 -- 头像层级
if this.playerHead then if this.playerInfoView then
this.playerHead:SetLayer(self.sortingOrder) this.playerInfoView:SetLayer(self.sortingOrder)
end end
end end
@ -694,10 +633,14 @@ function FightPointPassMainPanel:OnDestroy()
SubUIManager.Close(this.UpView) SubUIManager.Close(this.UpView)
SubUIManager.Close(this.BtView) SubUIManager.Close(this.BtView)
ClearRedPointObject(RedPointType.DailyTaskMain, this.DailyRedPoint) ClearRedPointObject(RedPointType.DailyTaskMain, this.DailyRedPoint)
ClearRedPointObject(RedPointType.Setting, this.headRedpot)
ClearRedPointObject(RedPointType.VipPrivilege, this.vipRedPoint)
ClearRedPointObject(RedPointType.SecretTer_IsCanFight, this.fightRP) ClearRedPointObject(RedPointType.SecretTer_IsCanFight, this.fightRP)
ClearRedPointObject(RedPointType.XiaoYaoYouRedPoint, this.xiaoyaoRedPoint) ClearRedPointObject(RedPointType.XiaoYaoYouRedPoint, this.xiaoyaoRedPoint)
-- 头像层级
if this.playerInfoView then
SubUIManager.Close(this.playerInfoView)
this.playerInfoView = nil
end
end end
--跳转显示新手提示圈 --跳转显示新手提示圈
function FightPointPassMainPanel.ShowGuideGo(btnIndex) function FightPointPassMainPanel.ShowGuideGo(btnIndex)

View File

@ -173,7 +173,10 @@ function this.SetRoleWalk(middleFightId)
local pos = Vector3.New(oldMainLevelSettingConfig.ChapterRolePosition[1]+30, oldMainLevelSettingConfig.ChapterRolePosition[2]-100,100) local pos = Vector3.New(oldMainLevelSettingConfig.ChapterRolePosition[1]+30, oldMainLevelSettingConfig.ChapterRolePosition[2]-100,100)
local targetPos = tagerPos local targetPos = tagerPos
local speed = 5 -- 越大越慢 local speed = 5 -- 越大越慢
if this.liveNode == nil then
this.liveNode = PlayerLiveView:New(Util.GetTransform(root, "mapParent/selectMap/Image (1)/roleRoot"),1)
this.liveNode:OnOpen(GetPlayerRoleSingleConFig().Scale5,Vector3.New(0,40,0),WALK_DIR.IDLE_FRONT)
end
this.liveNode.leader.transform:DOLocalMove(targetPos, speed / 5, false):OnStart(function () this.liveNode.leader.transform:DOLocalMove(targetPos, speed / 5, false):OnStart(function ()
this.SetRoleDirAction(targetPos.x, targetPos.y, pos.x, pos.y) this.SetRoleDirAction(targetPos.x, targetPos.y, pos.x, pos.y)
end):OnUpdate(function() --TODO:测试速度 end):OnUpdate(function() --TODO:测试速度

View File

@ -111,21 +111,10 @@ function GuildMainCityPanel:InitComponent()
this.btnResult = Util.GetGameObject(this.rightBox, "result") this.btnResult = Util.GetGameObject(this.rightBox, "result")
this.btnRedPacket=Util.GetGameObject(this.rightBox,"redPacket") this.btnRedPacket=Util.GetGameObject(this.rightBox,"redPacket")
this.btnRedPacketRedPoint=Util.GetGameObject(this.btnRedPacket,"redPoint") this.btnRedPacketRedPoint=Util.GetGameObject(this.btnRedPacket,"redPoint")
-- 嚣张的头像
this.level = Util.GetGameObject(self.gameObject, "LeftUp/headBox/lvFrame/lv"):GetComponent("Text")
this.playName = Util.GetGameObject(self.gameObject, "LeftUp/headBox/name"):GetComponent("Text")
this.expSliderValue = Util.GetGameObject(self.gameObject, "LeftUp/headBox/exp"):GetComponent("Slider")
this.expSliderValue.transform.localScale = Vector3.New(UIManager.adapterScale, 1, 1)
this.headBox = Util.GetGameObject(self.gameObject, "LeftUp/headBox") if not this.playerInfoView then
this.headPos = Util.GetGameObject(self.gameObject, "LeftUp/headBox/headpos") this.playerInfoView = SubUIManager.Open(SubUIConfig.PlayerInfoView, this.transform)
this.headRedpot = Util.GetGameObject(self.gameObject, "LeftUp/headBox/redpot") end
this.teamPower = Util.GetGameObject(self.gameObject, "LeftUp/powerBtn/value"):GetComponent("Text")
-- 特权
this.vipPrivilegeBtn = Util.GetGameObject(self.gameObject, "LeftUp/vipPrivilege/vipPrivilegeBtn")
this.vipLevelText = Util.GetGameObject(this.vipPrivilegeBtn, "bg/vip"):GetComponent("Image")
this.vipRedPoint = Util.GetGameObject(self.gameObject, "LeftUp/vipPrivilege/redPoint")
screenAdapte(this.vipPrivilegeBtn)
-- 聊天 -- 聊天
this.ChatTipView = SubUIManager.Open(SubUIConfig.ChatTipView, self.transform, 2) this.ChatTipView = SubUIManager.Open(SubUIConfig.ChatTipView, self.transform, 2)
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, { showType = UpViewOpenType.ShowLeft }) this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform, { showType = UpViewOpenType.ShowLeft })
@ -222,19 +211,8 @@ function GuildMainCityPanel:BindEvent()
UIManager.OpenPanel(UIName.RedPacketPanel) UIManager.OpenPanel(UIName.RedPacketPanel)
end) end)
-- 点击你的猪头
Util.AddClick(this.headBox, function ()
UIManager.OpenPanel(UIName.SettingPanel)
end)
Util.AddClick(this.vipPrivilegeBtn, function()
UIManager.OpenPanel(UIName.VipPanelV2)
end)
-- 绑定红点 -- 绑定红点
BindRedPointObject(RedPointType.Guild_RedPacket, this.btnRedPacketRedPoint) BindRedPointObject(RedPointType.Guild_RedPacket, this.btnRedPacketRedPoint)
BindRedPointObject(RedPointType.Setting, this.headRedpot)
BindRedPointObject(RedPointType.VipPrivilege, this.vipRedPoint)
end end
--添加事件监听(用于子类重写) --添加事件监听(用于子类重写)
@ -249,7 +227,6 @@ function GuildMainCityPanel:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.GuildFight.AttackStageDefendDataUpdate, this.RefreshGetStar) Game.GlobalEvent:AddEvent(GameEvent.GuildFight.AttackStageDefendDataUpdate, this.RefreshGetStar)
Game.GlobalEvent:AddEvent(GameEvent.GuildRedPacket.OnCloseRedPointClick, this.CloseRedPointClick) Game.GlobalEvent:AddEvent(GameEvent.GuildRedPacket.OnCloseRedPointClick, this.CloseRedPointClick)
Game.GlobalEvent:AddEvent(GameEvent.Guild.RefreshDeathPosStatus, this.RefreshDeathPos) Game.GlobalEvent:AddEvent(GameEvent.Guild.RefreshDeathPosStatus, this.RefreshDeathPos)
Game.GlobalEvent:AddEvent(GameEvent.Player.OnChangeName, this.FreshPlayerInfo)
end end
--移除事件监听(用于子类重写) --移除事件监听(用于子类重写)
@ -264,7 +241,6 @@ function GuildMainCityPanel:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.GuildFight.AttackStageDefendDataUpdate, this.RefreshGetStar) Game.GlobalEvent:RemoveEvent(GameEvent.GuildFight.AttackStageDefendDataUpdate, this.RefreshGetStar)
Game.GlobalEvent:RemoveEvent(GameEvent.GuildRedPacket.OnCloseRedPointClick, this.CloseRedPointClick) Game.GlobalEvent:RemoveEvent(GameEvent.GuildRedPacket.OnCloseRedPointClick, this.CloseRedPointClick)
Game.GlobalEvent:RemoveEvent(GameEvent.Guild.RefreshDeathPosStatus, this.RefreshDeathPos) Game.GlobalEvent:RemoveEvent(GameEvent.Guild.RefreshDeathPosStatus, this.RefreshDeathPos)
Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnChangeName, this.FreshPlayerInfo)
end end
--界面打开时调用(用于子类重写) --界面打开时调用(用于子类重写)
@ -301,8 +277,6 @@ function GuildMainCityPanel:OnShow()
this._TimeCounter = Timer.New(this._TimeUpdate, 1, -1, true) this._TimeCounter = Timer.New(this._TimeUpdate, 1, -1, true)
this._TimeCounter:Start() this._TimeCounter:Start()
end end
this.FreshPlayerInfo()
this.SetPlayerHead()
if not RECHARGEABLE then--(是否开启充值) if not RECHARGEABLE then--(是否开启充值)
this.btnRedPacket:SetActive(false) this.btnRedPacket:SetActive(false)
@ -315,34 +289,13 @@ function GuildMainCityPanel:OnShow()
end end
end end
-- 刷新玩家信息显示
function this.FreshPlayerInfo()
this.vipLevelText.sprite = VipManager.SetVipLevelImg()
this.level.text = PlayerManager.level
this.expSliderValue.value = PlayerManager.exp / PlayerManager.userLevelData[PlayerManager.level].Exp
this.playName.text = PlayerManager.nickName
this.teamPower.text = FormationManager.GetFormationPower(FormationManager.curFormationIndex)
end
-- 设置头像
function this.SetPlayerHead()
if not this.playerHead then
this.playerHead = SubUIManager.Open(SubUIConfig.PlayerHeadView, this.headPos.transform)
end
this.playerHead:SetHead(PlayerManager.head)
this.playerHead:SetFrame(HeadManager.GetCurFrameId())
this.playerHead:SetScale(Vector3.one * 0.9)
this.playerHead:SetPosition(Vector3.New(-5, 8, 0))
this.playerHead:SetLayer(this.sortingOrder)
this.playerHead:SetEffectScale(0.85)
end
function this:OnSortingOrderChange() function this:OnSortingOrderChange()
if this.playerHead then if this.playerHead then
this.playerHead:SetLayer(self.sortingOrder) this.playerHead:SetLayer(self.sortingOrder)
end end
if this.playerInfoView then
this.playerInfoView:SetLayer(self.sortingOrder)
end
end end
function this.RefreshStageShow() function this.RefreshStageShow()
-- 关闭按钮显示 -- 关闭按钮显示
@ -594,8 +547,6 @@ function GuildMainCityPanel:OnDestroy()
-- 清除红点 -- 清除红点
ClearRedPointObject(RedPointType.Guild_RedPacket, this.btnRedPacketRedPoint) ClearRedPointObject(RedPointType.Guild_RedPacket, this.btnRedPacketRedPoint)
ClearRedPointObject(RedPointType.Setting, this.headRedpot)
ClearRedPointObject(RedPointType.VipPrivilege, this.vipRedPoint)
this.playerHead = nil this.playerHead = nil
@ -604,6 +555,10 @@ function GuildMainCityPanel:OnDestroy()
this.LiveName = nil this.LiveName = nil
this.LiveGO = nil this.LiveGO = nil
end end
if this.playerInfoView then
SubUIManager.Close(this.playerInfoView)
this.playerInfoView = nil
end
end end
return GuildMainCityPanel return GuildMainCityPanel

View File

@ -469,6 +469,7 @@ function this.SetPlayerMountTime(id,validTime)
singData.overTime = validTime singData.overTime = validTime
this.userMountList[singData.mountId] = singData this.userMountList[singData.mountId] = singData
this.SetPlayerRideRedPoint(PlayerTitleRideSkinRedPointTypeStr.Ride,1) this.SetPlayerRideRedPoint(PlayerTitleRideSkinRedPointTypeStr.Ride,1)
FormationManager.UserPowerChanged()
end end
else--为空时是删除数据 倒计时结束时 else--为空时是删除数据 倒计时结束时
if this.userMountList[id] then if this.userMountList[id] then

View File

@ -765,5 +765,8 @@ function this:ResolveUpdateHeroInfoData()
end end
end end
this:UpdateHeroInfoData()--刷新界面方法 this:UpdateHeroInfoData()--刷新界面方法
if isUpZhen then
FormationManager.UserPowerChanged()
end
end end
return this return this

View File

@ -266,5 +266,6 @@ function this.RefrehsHeroAndTalisman()
end end
end end
this:OnShowHeroAndTalisman()--刷新界面方法 this:OnShowHeroAndTalisman()--刷新界面方法
FormationManager.UserPowerChanged()
end end
return RoleTalismanPanelV2 return RoleTalismanPanelV2

View File

@ -25,19 +25,11 @@ function VipPanelV2:InitComponent()
screenAdapte(self.bg) screenAdapte(self.bg)
end end
if not this.playerInfoView then
this.playerInfoView = SubUIManager.Open(SubUIConfig.PlayerInfoView, this.transform)
end
this.BtView = SubUIManager.Open(SubUIConfig.BtView, self.transform) this.BtView = SubUIManager.Open(SubUIConfig.BtView, self.transform)
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.transform) this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.transform)
-- 嚣张的头像
this.level = Util.GetGameObject(self.gameObject, "LeftUp/headBox/lvFrame/lv"):GetComponent("Text")
this.playName = Util.GetGameObject(self.gameObject, "LeftUp/headBox/name"):GetComponent("Text")
this.expSliderValue = Util.GetGameObject(self.gameObject, "LeftUp/headBox/exp"):GetComponent("Slider")
this.expSliderValue.transform.localScale = Vector3.New(UIManager.adapterScale, 1, 1)
this.headBox = Util.GetGameObject(self.gameObject, "LeftUp/headBox")
this.headPos = Util.GetGameObject(self.gameObject, "LeftUp/headBox/headpos")
this.headRedpot = Util.GetGameObject(self.gameObject, "LeftUp/headBox/redpot")
this.teamPower = Util.GetGameObject(self.gameObject, "LeftUp/powerBtn/value"):GetComponent("Text")
-- self.BtnBack = Util.GetGameObject(self.transform, "btnBack") -- self.BtnBack = Util.GetGameObject(self.transform, "btnBack")
-- this.helpBtn = Util.GetGameObject(self.gameObject, "helpBtn") -- this.helpBtn = Util.GetGameObject(self.gameObject, "helpBtn")
-- this.helpPosition=this.helpBtn:GetComponent("RectTransform").localPosition -- this.helpPosition=this.helpBtn:GetComponent("RectTransform").localPosition
@ -90,28 +82,6 @@ function VipPanelV2:InitComponent()
end end
end end
-- 刷新玩家信息显示
function this.FreshPlayerInfo()
this.level.text = PlayerManager.level
this.expSliderValue.value = PlayerManager.exp / PlayerManager.userLevelData[PlayerManager.level].Exp
this.playName.text = PlayerManager.nickName
this.teamPower.text = FormationManager.GetFormationPower(FormationManager.curFormationIndex)
end
-- 设置头像
function this.SetPlayerHead()
if not this.playerHead then
this.playerHead = SubUIManager.Open(SubUIConfig.PlayerHeadView, this.headPos.transform)
end
this.playerHead:SetHead(PlayerManager.head)
this.playerHead:SetFrame(HeadManager.GetCurFrameId())
this.playerHead:SetScale(Vector3.one * 0.9)
this.playerHead:SetPosition(Vector3.New(-5, 8, 0))
this.playerHead:SetLayer(this.sortingOrder)
this.playerHead:SetEffectScale(0.85)
end
function VipPanelV2:BindEvent() function VipPanelV2:BindEvent()
--帮助按钮 --帮助按钮
@ -171,16 +141,17 @@ function VipPanelV2:OnSortingOrderChange()
Util.AddParticleSortLayer(self.effect, self.sortingOrder - orginLayer) Util.AddParticleSortLayer(self.effect, self.sortingOrder - orginLayer)
orginLayer = self.sortingOrder orginLayer = self.sortingOrder
-- 头像层级 -- 头像层级
if this.playerHead then -- if this.playerHead then
this.playerHead:SetLayer(self.sortingOrder) -- this.playerHead:SetLayer(self.sortingOrder)
-- end
if this.playerInfoView then
this.playerInfoView:SetLayer(self.sortingOrder)
end end
end end
function VipPanelV2:OnShow() function VipPanelV2:OnShow()
self:InitVipContext() self:InitVipContext()
self:SetPanelStatus() self:SetPanelStatus()
this.FreshPlayerInfo()
this.SetPlayerHead()
end end
function VipPanelV2:OnClose() function VipPanelV2:OnClose()
@ -199,9 +170,13 @@ function VipPanelV2:OnDestroy()
SubUIManager.Close(this.UpView) SubUIManager.Close(this.UpView)
SubUIManager.Close(this.BtView) SubUIManager.Close(this.BtView)
SubUIManager.Close(this.playerHead) SubUIManager.Close(this.playerHead)
this.playerHead = nil -- this.playerHead = nil
this.UpView = nil this.UpView = nil
this.BtView = nil this.BtView = nil
if this.playerInfoView then
SubUIManager.Close(this.playerInfoView)
this.playerInfoView = nil
end
end end
function VipPanelV2:InitVipContext() function VipPanelV2:InitVipContext()
@ -490,9 +465,14 @@ function VipPanelV2:OnTurnRightBtnClicked()
end end
function VipPanelV2:OnBtnLvUpClicked() function VipPanelV2:OnBtnLvUpClicked()
local oldPowerNum = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
NetManager.RequestVipLevelUp(function(respond) NetManager.RequestVipLevelUp(function(respond)
self:OnShow() self:OnShow()
SoundManager.PlaySound(SoundConfig.Sound_VipUpLevel) SoundManager.PlaySound(SoundConfig.Sound_VipUpLevel)
local newPowerNum = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
if oldPowerNum ~= newPowerNum then
UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = oldPowerNum,newValue = newPowerNum})
end
end) end)
end end

View File

@ -28,7 +28,7 @@ function PlayerInfoView:InitComponent()
-- 特权 -- 特权
self.vipPrivilegeBtn = Util.GetGameObject(self.gameObject, "vipPrivilege/vipPrivilegeBtn") self.vipPrivilegeBtn = Util.GetGameObject(self.gameObject, "vipPrivilege/vipPrivilegeBtn")
self.vipLevelText = Util.GetGameObject(self.vipPrivilegeBtn, "bg/vip"):GetComponent("Image") self.vipLevelText = Util.GetGameObject(self.vipPrivilegeBtn, "bg/vip"):GetComponent("Image")
self.vipRedPoint = Util.GetGameObject(self.gameObject, "vipPrivilege/redPoint") self.vipRedPoint = Util.GetGameObject(self.gameObject, "vipPrivilege/vipPrivilegeBtn/redPoint")
screenAdapte(self.vipPrivilegeBtn) screenAdapte(self.vipPrivilegeBtn)
end end
@ -37,7 +37,7 @@ end
function PlayerInfoView:BindEvent() function PlayerInfoView:BindEvent()
--GM工具 --GM工具
Util.AddClick(self.headBox, function() Util.AddClick(self.headBox, function()
if AppConst.isOpenGM then if AppConst.isOpenGM and UIManager.IsOpen(UIName.MainPanel) then
UIManager.OpenPanel(UIName.GMPanel) UIManager.OpenPanel(UIName.GMPanel)
else else
UIManager.OpenPanel(UIName.SettingPanel) UIManager.OpenPanel(UIName.SettingPanel)
@ -54,6 +54,9 @@ end
function PlayerInfoView:AddListener() function PlayerInfoView:AddListener()
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, self.OnShow, self) Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, self.OnShow, self)
Game.GlobalEvent:AddEvent(GameEvent.Player.OnPlayerLvChange, self.OnShow, self) Game.GlobalEvent:AddEvent(GameEvent.Player.OnPlayerLvChange, self.OnShow, self)
Game.GlobalEvent:AddEvent(GameEvent.Player.OnChangeName, self.OnShow, self)
Game.GlobalEvent:AddEvent(GameEvent.Player.OnHeadFrameChange, self.OnShow, self)
Game.GlobalEvent:AddEvent(GameEvent.Player.OnHeadChange, self.OnShow, self)
Game.GlobalEvent:AddEvent(GameEvent.Formation.OnFormationChange, self.RefreshPower, self) Game.GlobalEvent:AddEvent(GameEvent.Formation.OnFormationChange, self.RefreshPower, self)
-- 绑定红点 -- 绑定红点
@ -65,6 +68,9 @@ end
function PlayerInfoView:RemoveListener() function PlayerInfoView:RemoveListener()
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold, self.OnShow, self) Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold, self.OnShow, self)
Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnPlayerLvChange, self.OnShow, self) Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnPlayerLvChange, self.OnShow, self)
Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnChangeName, self.OnShow, self)
Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnHeadFrameChange, self.OnShow, self)
Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnHeadChange, self.OnShow, self)
Game.GlobalEvent:RemoveEvent(GameEvent.Formation.OnFormationChange, self.RefreshPower, self) Game.GlobalEvent:RemoveEvent(GameEvent.Formation.OnFormationChange, self.RefreshPower, self)
-- 解除绑定 -- 解除绑定