From 9bd410376896a64665ca2b991a6985ee884b27dc Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Wed, 2 Jun 2021 18:26:31 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=A7=B0=E5=8F=B7=E3=80=91=3D=3D=3D?= =?UTF-8?q?=3D=E7=A7=B0=E5=8F=B7=E7=89=B9=E6=95=88=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Common/GlobalDefine.lua | 7 ++++ .../Modules/Fight/FightSmallChoosePanel.lua | 2 +- .../~Lua/Modules/Main/View/MainPlayerView.lua | 2 +- .../~Lua/Modules/Popup/PlayerInfoPopup.lua | 39 +++++++++++-------- .../~Lua/View/PlayerLiveView.lua | 21 +++++++--- .../~Lua/View/SingleFightPlayerView.lua | 4 +- 6 files changed, 50 insertions(+), 25 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua index 72fed707ea..f097a5b6bb 100644 --- a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua +++ b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua @@ -1038,6 +1038,13 @@ JumpType = { XinJiangLaiXiShangDian = 20200, --社稷大典商店 XingChenShangDian = 20059, --星辰商店 } + +NPCPosType={ + maincity=1, + + +} + YaoHunFrame = { --[6] = "r_tongyong_yaohunkuang002", --[7] = "r_tongyong_yaohunkuang001", diff --git a/Assets/ManagedResources/~Lua/Modules/Fight/FightSmallChoosePanel.lua b/Assets/ManagedResources/~Lua/Modules/Fight/FightSmallChoosePanel.lua index 32e218f047..aa250eea88 100644 --- a/Assets/ManagedResources/~Lua/Modules/Fight/FightSmallChoosePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Fight/FightSmallChoosePanel.lua @@ -89,7 +89,7 @@ function FightSmallChoosePanel:OnShow() if self.liveNode then self.liveNode:OnClose() end - self.liveNode = PlayerLiveView:New(Util.GetGameObject(self.selectMap, "pos"),1) + self.liveNode = PlayerLiveView:New(Util.GetGameObject(self.selectMap, "pos"),self.sortingOrder) self.liveNode:OnOpen(GetPlayerRoleSingleConFig().Scale4,Vector3.New(0,40,0)) if FightPointPassManager.GetRoleDirection()==1 then self.liveNode:SetWalkDir(WALK_DIR.RUN_LEFT) diff --git a/Assets/ManagedResources/~Lua/Modules/Main/View/MainPlayerView.lua b/Assets/ManagedResources/~Lua/Modules/Main/View/MainPlayerView.lua index 2c58a4025c..cfa66e9b51 100644 --- a/Assets/ManagedResources/~Lua/Modules/Main/View/MainPlayerView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Main/View/MainPlayerView.lua @@ -29,7 +29,7 @@ function MainPlayerView.New(isSelf, root, rect, pos,_NpvData,sortingOrder) Util.GetGameObject(instance.leader, "name/text"):SetActive(true) Util.GetGameObject(instance.leader, "name/text2"):SetActive(false) _sex = NameManager.roleSex - instance.NpcGO = PlayerLiveView:New(instance.roleRootTran,1, nil,sortingOrder) + instance.NpcGO = PlayerLiveView:New(instance.roleRootTran,1, nil,sortingOrder,NPCPosType.maincity) if PlayerManager.GetPlayerRide() > 0 then Util.GetGameObject(instance.leader, "name").transform.localPosition = Vector3.New(0,239.9,0) diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua b/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua index 1f3f1628f2..4b0b027e56 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua @@ -203,11 +203,11 @@ function this.RefreshPlayerInfo(data) if not _PlayerHead then _PlayerHead = SubUIManager.Open(SubUIConfig.PlayerHeadView, this.memHead.transform) end - if titleLive then - poolManager:UnLoadAsset(titleLiveStr, titleLive, PoolManager.AssetType.GameObject) - titleLive = nil - titleLiveStr = nil - end + -- if titleLive then + -- poolManager:UnLoadAsset(titleLiveStr, titleLive, PoolManager.AssetType.GameObject) + -- titleLive = nil + -- titleLiveStr = nil + -- end _PlayerHead:Reset() _PlayerHead:SetScale(Vector3.one * 0.85) _PlayerHead:SetHead(data.head) @@ -218,18 +218,25 @@ function this.RefreshPlayerInfo(data) local title=data.userTitle if title and title>0 then this.titlePar:SetActive(true) - local curPlayerRole = ConfigManager.GetConfigData(ConfigName.PlayerRole,title) - local curArtResourcesConfig = ConfigManager.GetConfigData(ConfigName.ArtResourcesConfig,curPlayerRole.LiveAnimName) - titleLiveStr = curArtResourcesConfig.Name - titleLive = poolManager:LoadAsset(titleLiveStr, PoolManager.AssetType.GameObject) - titleLive.transform:SetParent(this.titlePar.transform) - titleLive.transform.localPosition = Vector3.New(0,0,0) - titleLive.transform.localScale = Vector3.New(0.5,0.5,0.5) - local sortingorder=0 - if this.sortingOrder then - Util.AddParticleSortLayer(titleLive,this.sortingOrder - sortingorder) - sortingorder = this.sortingOrder + -- local curPlayerRole = ConfigManager.GetConfigData(ConfigName.PlayerRole,title) + -- local curArtResourcesConfig = ConfigManager.GetConfigData(ConfigName.ArtResourcesConfig,curPlayerRole.LiveAnimName) + -- titleLiveStr = curArtResourcesConfig.Name + -- titleLive = poolManager:LoadAsset(titleLiveStr, PoolManager.AssetType.GameObject) + -- titleLive.transform:SetParent(this.titlePar.transform) + -- titleLive.transform.localPosition = Vector3.New(0,0,0) + -- titleLive.transform.localScale = Vector3.New(0.5,0.5,0.5) + -- local sortingorder=0 + -- if this.sortingOrder then + -- Util.AddParticleSortLayer(titleLive,this.sortingOrder - sortingorder) + -- sortingorder = this.sortingOrder + -- end + LogError("title=="..title) + if not titleLive then + titleLive = SubUIManager.Open(SubUIConfig.PlayerTitle, this.titlePar.transform) + titleLive:SetShow(title, Vector3.New(0,0,0), 0.5, 0.03*20, this.sortingOrder) end + + else this.titlePar:SetActive(false) end diff --git a/Assets/ManagedResources/~Lua/View/PlayerLiveView.lua b/Assets/ManagedResources/~Lua/View/PlayerLiveView.lua index 3690389581..95eab5bd7f 100644 --- a/Assets/ManagedResources/~Lua/View/PlayerLiveView.lua +++ b/Assets/ManagedResources/~Lua/View/PlayerLiveView.lua @@ -7,7 +7,7 @@ local mapNpcOp = "PlayerLiveView" -- designation = 80010 -- } -function PlayerLiveView:New(gameObject,_Type, PlayerLiveViewData,orginLayer) +function PlayerLiveView:New(gameObject,_Type, PlayerLiveViewData,orginLayer,posType) -- Type = _Type -- local b = {} -- b.gameObject = gameObject @@ -39,7 +39,7 @@ function PlayerLiveView:New(gameObject,_Type, PlayerLiveViewData,orginLayer) instance.playerLiveGo = Util.GetGameObject(instance.leader, "liveParent/playerLive") instance.titleLiveGo = Util.GetGameObject(instance.leader, "liveParent/titleLive") instance.nameHeight=0 - + instance.posType=posType --立绘对象 instance.rideLive = nil instance.playerLive = nil @@ -83,22 +83,23 @@ end --界面打开时调用(用于子类重写) function PlayerLiveView:OnOpen(scale,pos,dir) - self:OnShowLive() if scale then self.leader.transform.localScale = Vector3.New(scale,scale,scale) end if pos then self.leader.transform.localPosition = pos end + self:OnShowLive() if dir then self:SetWalkDir(dir) end end local sortingorder=0 -function PlayerLiveView:OnSortingOrderChange(sortingOrder) +function PlayerLiveView:OnSortingOrderChange(sortingOrder1) + sortingorder=sortingOrder1 if self.titleLive then - self.titleLive:SetLayer(sortingOrder) + self.titleLive:SetLayer(sortingOrder1) end end @@ -164,7 +165,15 @@ function PlayerLiveView:OnShowLive() y=y+3 end local curLocalPosition = Vector3.New(curArtResourcesConfig.Position[1],y,0) - self.titleLive:SetShow(self.PlayerLiveViewData.designation, curLocalPosition, curArtResourcesConfig.Scale, curArtResourcesConfig.Scale* self.transform.localScale.x, self.orginLayer) + LogError("scale=="..curArtResourcesConfig.Scale.." transform scale=="..self.leader.transform.localScale.x) + -- curArtResourcesConfig.Scale* self.transform.localScale.x + local effect=0 + if self.posType==NPCPosType.maincity then + effect=self.transform.localScale.x + else + effect=self.leader.transform.localScale.x + end + self.titleLive:SetShow(self.PlayerLiveViewData.designation, curLocalPosition, curArtResourcesConfig.Scale, curArtResourcesConfig.Scale*effect,self.orginLayer) end end function PlayerLiveView:SetNameHeight(hei) diff --git a/Assets/ManagedResources/~Lua/View/SingleFightPlayerView.lua b/Assets/ManagedResources/~Lua/View/SingleFightPlayerView.lua index 4b91969f9d..f909659a47 100644 --- a/Assets/ManagedResources/~Lua/View/SingleFightPlayerView.lua +++ b/Assets/ManagedResources/~Lua/View/SingleFightPlayerView.lua @@ -583,7 +583,9 @@ function SingleFightPlayerView:SetIconShow(_eventpoint) self.eventPointPos:SetDialogueStr(strList1[num]) Timer.New(function() if self.dialogueRoot then - self.dialogueRoot.gameObject:SetActive(false) + if self.dialogueRoot.gameObject then + self.dialogueRoot.gameObject:SetActive(false) + end end if self.state == 1 then self.eventPointPos:ShowDialogue(true)