【称号】修改称号节点为通用节点
parent
b2a71d4f8c
commit
39bb3d5c06
|
@ -7,7 +7,7 @@ Material:
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: fx_tex_lizhi
|
m_Name: fx_tex_lizhi_mat
|
||||||
m_Shader: {fileID: 4800000, guid: cd73b754ea97c04468b1349981704714, type: 3}
|
m_Shader: {fileID: 4800000, guid: cd73b754ea97c04468b1349981704714, type: 3}
|
||||||
m_ShaderKeywords:
|
m_ShaderKeywords:
|
||||||
m_LightmapFlags: 0
|
m_LightmapFlags: 0
|
||||||
|
|
|
@ -453,7 +453,6 @@ GameObject:
|
||||||
serializedVersion: 6
|
serializedVersion: 6
|
||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 6361193509961736898}
|
- component: {fileID: 6361193509961736898}
|
||||||
- component: {fileID: 7146534821247858850}
|
|
||||||
m_Layer: 5
|
m_Layer: 5
|
||||||
m_Name: UI_Effect_MianBan_ChengHao_Tslx
|
m_Name: UI_Effect_MianBan_ChengHao_Tslx
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
@ -488,27 +487,6 @@ RectTransform:
|
||||||
m_AnchoredPosition: {x: 7, y: 338}
|
m_AnchoredPosition: {x: 7, y: 338}
|
||||||
m_SizeDelta: {x: 100, y: 100}
|
m_SizeDelta: {x: 100, y: 100}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!223 &7146534821247858850
|
|
||||||
Canvas:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 4163563969343386189}
|
|
||||||
m_Enabled: 1
|
|
||||||
serializedVersion: 3
|
|
||||||
m_RenderMode: 2
|
|
||||||
m_Camera: {fileID: 0}
|
|
||||||
m_PlaneDistance: 100
|
|
||||||
m_PixelPerfect: 0
|
|
||||||
m_ReceivesEvents: 1
|
|
||||||
m_OverrideSorting: 1
|
|
||||||
m_OverridePixelPerfect: 0
|
|
||||||
m_SortingBucketNormalizedSize: 0
|
|
||||||
m_AdditionalShaderChannelsFlag: 0
|
|
||||||
m_SortingLayerID: 0
|
|
||||||
m_SortingOrder: 0
|
|
||||||
m_TargetDisplay: 0
|
|
||||||
--- !u!1 &4320119772942752865
|
--- !u!1 &4320119772942752865
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1 &7231000919449340602
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 4032346249059119572}
|
||||||
|
- component: {fileID: 3204280713171133639}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: PlayerTitile
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &4032346249059119572
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7231000919449340602}
|
||||||
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: -1}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchoredPosition: {x: 0, y: 0}
|
||||||
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!223 &3204280713171133639
|
||||||
|
Canvas:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 7231000919449340602}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 3
|
||||||
|
m_RenderMode: 2
|
||||||
|
m_Camera: {fileID: 0}
|
||||||
|
m_PlaneDistance: 100
|
||||||
|
m_PixelPerfect: 0
|
||||||
|
m_ReceivesEvents: 1
|
||||||
|
m_OverrideSorting: 1
|
||||||
|
m_OverridePixelPerfect: 0
|
||||||
|
m_SortingBucketNormalizedSize: 0
|
||||||
|
m_AdditionalShaderChannelsFlag: 0
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
m_TargetDisplay: 0
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a015dee4ae92d6545a25425ec3f30cf8
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -422,6 +422,7 @@ SubUIConfig = {
|
||||||
RoleUpStarLayout = { name = "RoleUpStarLayout",assetName = "RoleUpStarLayout",script = "Modules/RoleInfo/RoleUpStarLayout" },
|
RoleUpStarLayout = { name = "RoleUpStarLayout",assetName = "RoleUpStarLayout",script = "Modules/RoleInfo/RoleUpStarLayout" },
|
||||||
SingleFightPlayerView = { name = "SingleFightPlayerView",assetName = "SingleFightPlayerView",script = "View/SingleFightPlayerView" }, -- 挂机界面一个人
|
SingleFightPlayerView = { name = "SingleFightPlayerView",assetName = "SingleFightPlayerView",script = "View/SingleFightPlayerView" }, -- 挂机界面一个人
|
||||||
SingleStoryPlayerView = { name = "SingleStoryPlayerView",assetName = "SingleStoryPlayerView",script = "View/SingleStoryPlayerView" } , --剧情界面一个对象
|
SingleStoryPlayerView = { name = "SingleStoryPlayerView",assetName = "SingleStoryPlayerView",script = "View/SingleStoryPlayerView" } , --剧情界面一个对象
|
||||||
|
PlayerTitle = {name = "PlayerTitle",assetName = "PlayerTitle",script = "View/PlayerTitle"},
|
||||||
[1] = {name = "EveryDayGift",assetName = "EveryDayGift",script = "Modules/Recharge/View/EveryDayGift"},
|
[1] = {name = "EveryDayGift",assetName = "EveryDayGift",script = "Modules/Recharge/View/EveryDayGift"},
|
||||||
[2] = {name = "GiftPre",assetName = "GiftPre",script = "Modules/Recharge/View/GiftPre"},
|
[2] = {name = "GiftPre",assetName = "GiftPre",script = "Modules/Recharge/View/GiftPre"},
|
||||||
[3] = {name = "RechargeView",assetName = "RechargeView",script = "Modules/Recharge/View/RechargeView"},
|
[3] = {name = "RechargeView",assetName = "RechargeView",script = "Modules/Recharge/View/RechargeView"},
|
||||||
|
|
|
@ -673,7 +673,7 @@ end
|
||||||
|
|
||||||
function this.SubmitGameData()
|
function this.SubmitGameData()
|
||||||
local isNewRole = PlayerPrefs.GetString(tostring(PlayerManager.uid), "")
|
local isNewRole = PlayerPrefs.GetString(tostring(PlayerManager.uid), "")
|
||||||
if isNewRole == "" then
|
if isNewRole == "" and PlayerManager.level == 1 then
|
||||||
PlayerPrefs.SetString(tostring(PlayerManager.uid), tostring(PlayerManager.uid))
|
PlayerPrefs.SetString(tostring(PlayerManager.uid), tostring(PlayerManager.uid))
|
||||||
SubmitExtraData({ type = SDKSubMitType.TYPE_CREATE_ROLE })
|
SubmitExtraData({ type = SDKSubMitType.TYPE_CREATE_ROLE })
|
||||||
end
|
end
|
||||||
|
|
|
@ -707,6 +707,14 @@ function this:OnSortingOrderChange()
|
||||||
if this.playerInfoView then
|
if this.playerInfoView then
|
||||||
this.playerInfoView:SetLayer(self.sortingOrder)
|
this.playerInfoView:SetLayer(self.sortingOrder)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if curNPCList then
|
||||||
|
for _, mpv in pairs(curNPCList) do
|
||||||
|
if mpv.OnSortingOrderChange then
|
||||||
|
mpv:OnSortingOrderChange(self.sortingOrder)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function this:OnOpen()
|
function this:OnOpen()
|
||||||
|
|
|
@ -96,6 +96,12 @@ function MainPlayerView:SetAutoMove()
|
||||||
self:SetAutoMove()
|
self:SetAutoMove()
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
function MainPlayerView:OnSortingOrderChange(sortingOrder)
|
||||||
|
if self.NpcGO and self.NpcGO.OnSortingOrderChange then
|
||||||
|
self.NpcGO:OnSortingOrderChange(sortingOrder)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function MainPlayerView:SetName()
|
function MainPlayerView:SetName()
|
||||||
self.NameText.text = PracticeManager.SetNameColor(PlayerManager.nickName,PracticeManager.PracticeLevel)
|
self.NameText.text = PracticeManager.SetNameColor(PlayerManager.nickName,PracticeManager.PracticeLevel)
|
||||||
|
|
|
@ -12,14 +12,8 @@ function SettingPlayerTitle:ctor(mainPanel, gameObject)
|
||||||
self:InitComponent(gameObject)
|
self:InitComponent(gameObject)
|
||||||
self:BindEvent()
|
self:BindEvent()
|
||||||
end
|
end
|
||||||
local titleLive
|
|
||||||
local titleLive2
|
|
||||||
local titleLiveCanvas
|
|
||||||
local titleLiveCanvas2
|
|
||||||
local _sortingorder = 0
|
|
||||||
|
|
||||||
local titleLiveStr
|
local _sortingorder = 0
|
||||||
local titleLiveStr2
|
|
||||||
local curUserRideId
|
local curUserRideId
|
||||||
--初始化组件(用于子类重写)
|
--初始化组件(用于子类重写)
|
||||||
function SettingPlayerTitle:InitComponent(gameObject,rootPanel)
|
function SettingPlayerTitle:InitComponent(gameObject,rootPanel)
|
||||||
|
@ -59,6 +53,11 @@ function SettingPlayerTitle:InitComponent(gameObject,rootPanel)
|
||||||
this.scrollViewPro.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5)
|
this.scrollViewPro.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5)
|
||||||
this.scrollViewPro.moveTween.MomentumAmount = 1
|
this.scrollViewPro.moveTween.MomentumAmount = 1
|
||||||
this.scrollViewPro.moveTween.Strength = 2
|
this.scrollViewPro.moveTween.Strength = 2
|
||||||
|
|
||||||
|
|
||||||
|
this.titleLive = SubUIManager.Open(SubUIConfig.PlayerTitle, this.live2dRootParent.transform)
|
||||||
|
this.titleLive2 = SubUIManager.Open(SubUIConfig.PlayerTitle, this.live2dRootParent2.transform)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--绑定事件(用于子类重写)
|
--绑定事件(用于子类重写)
|
||||||
|
@ -202,50 +201,15 @@ function this.SingleRideClickShowInfo(data,go)
|
||||||
sex = NameManager.roleSex,
|
sex = NameManager.roleSex,
|
||||||
ride =0,
|
ride =0,
|
||||||
}
|
}
|
||||||
if titleLive then
|
|
||||||
-- 特效大小修改后无法还原,所以直接删除
|
|
||||||
destroy(titleLive)
|
|
||||||
titleLive = nil
|
|
||||||
end
|
|
||||||
if titleLive2 then
|
|
||||||
-- 特效大小修改后无法还原,所以直接删除
|
|
||||||
destroy(titleLive2)
|
|
||||||
titleLive2 = nil
|
|
||||||
end
|
|
||||||
live2dRoot = PlayerLiveView:New(this.live2dRootParent,2, curPlayerLiveViewData)
|
live2dRoot = PlayerLiveView:New(this.live2dRootParent,2, curPlayerLiveViewData)
|
||||||
live2dRoot:OnOpen(GetPlayerRoleSingleConFig().Scale7,nil,WALK_DIR.IDLE_LEFT)
|
live2dRoot:OnOpen(GetPlayerRoleSingleConFig().Scale7,nil,WALK_DIR.IDLE_LEFT)
|
||||||
|
|
||||||
local curPlayerRole = ConfigManager.GetConfigData(ConfigName.PlayerRole,data.ItemId)
|
local curPlayerRole = ConfigManager.GetConfigData(ConfigName.PlayerRole,data.ItemId)
|
||||||
local curArtResourcesConfig = ConfigManager.GetConfigData(ConfigName.ArtResourcesConfig,curPlayerRole.LiveAnimName)
|
local curArtResourcesConfig = ConfigManager.GetConfigData(ConfigName.ArtResourcesConfig,curPlayerRole.LiveAnimName)
|
||||||
this.name.text = curArtResourcesConfig.Desc
|
this.name.text = curArtResourcesConfig.Desc
|
||||||
titleLiveStr = curArtResourcesConfig.Name
|
-- 设置称号显示
|
||||||
titleLive = poolManager:LoadAsset(titleLiveStr, PoolManager.AssetType.GameObject)
|
this.titleLive:SetShow(data.ItemId, Vector3.New(0,150,0), 0.5, 0.5, _sortingorder)
|
||||||
titleLive.transform:SetParent(this.live2dRootParent.transform)
|
this.titleLive2:SetShow(data.ItemId, Vector3.New(0,0,0), 1, 1, _sortingorder)
|
||||||
titleLive.transform.localPosition = Vector3.New(0,150,0)
|
|
||||||
titleLive.transform.localScale = Vector3.New(0.5,0.5,0.5)
|
|
||||||
Util.SetParticleScale(titleLive, 0.5)
|
|
||||||
Util.AddParticleSortLayer(titleLive, _sortingorder)
|
|
||||||
titleLiveCanvas = titleLive:GetComponent("Canvas")
|
|
||||||
if titleLiveCanvas then
|
|
||||||
titleLiveCanvas.overrideSorting = true
|
|
||||||
titleLiveCanvas.sortingOrder = _sortingorder
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local curPlayerRole = ConfigManager.GetConfigData(ConfigName.PlayerRole,data.ItemId)
|
|
||||||
local curArtResourcesConfig = ConfigManager.GetConfigData(ConfigName.ArtResourcesConfig,curPlayerRole.LiveAnimName)
|
|
||||||
titleLiveStr2 = curArtResourcesConfig.Name
|
|
||||||
titleLive2 = poolManager:LoadAsset(titleLiveStr, PoolManager.AssetType.GameObject)
|
|
||||||
titleLive2.transform:SetParent(this.live2dRootParent2.transform)
|
|
||||||
titleLive2.transform.localPosition = Vector3.New(0,0,0)
|
|
||||||
titleLive2.transform.localScale = Vector3.New(1,1,1)
|
|
||||||
Util.SetParticleScale(titleLive2, 1)
|
|
||||||
Util.AddParticleSortLayer(titleLive2, _sortingorder)
|
|
||||||
titleLiveCanvas2 = titleLive2:GetComponent("Canvas")
|
|
||||||
if titleLiveCanvas2 then
|
|
||||||
titleLiveCanvas2.overrideSorting = true
|
|
||||||
titleLiveCanvas2.sortingOrder = _sortingorder
|
|
||||||
end
|
|
||||||
|
|
||||||
Util.AddOnceClick(this.goToBtn, function()
|
Util.AddOnceClick(this.goToBtn, function()
|
||||||
if not isGet and not isUser then
|
if not isGet and not isUser then
|
||||||
|
@ -270,20 +234,13 @@ end
|
||||||
|
|
||||||
-- 界面层级变动
|
-- 界面层级变动
|
||||||
function SettingPlayerTitle:OnSortingOrderChange(sortingOrder)
|
function SettingPlayerTitle:OnSortingOrderChange(sortingOrder)
|
||||||
local titleSort = sortingOrder + 10
|
if this.titleLive then
|
||||||
if titleLive then
|
this.titleLive:SetLayer(sortingOrder)
|
||||||
Util.AddParticleSortLayer(titleLive, titleSort - _sortingorder)
|
|
||||||
end
|
end
|
||||||
if titleLive2 then
|
if this.titleLive2 then
|
||||||
Util.AddParticleSortLayer(titleLive2, titleSort - _sortingorder)
|
this.titleLive2:SetLayer(sortingOrder)
|
||||||
end
|
end
|
||||||
if titleLiveCanvas then
|
_sortingorder = sortingOrder
|
||||||
titleLiveCanvas.sortingOrder = titleSort
|
|
||||||
end
|
|
||||||
if titleLiveCanvas2 then
|
|
||||||
titleLiveCanvas2.sortingOrder = titleSort
|
|
||||||
end
|
|
||||||
_sortingorder = titleSort
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--界面关闭时调用(用于子类重写)
|
--界面关闭时调用(用于子类重写)
|
||||||
|
@ -300,12 +257,8 @@ end
|
||||||
function SettingPlayerTitle:OnDestroy()
|
function SettingPlayerTitle:OnDestroy()
|
||||||
_sortingorder = 0
|
_sortingorder = 0
|
||||||
this.spLoader:Destroy()
|
this.spLoader:Destroy()
|
||||||
titleLive=nil
|
SubUIManager.Close(this.titleLive)
|
||||||
titleLive2=nil
|
SubUIManager.Close(this.titleLive2)
|
||||||
titleLiveCanvas = nil
|
|
||||||
titleLiveCanvas2 = nil
|
|
||||||
titleLiveStr=nil
|
|
||||||
titleLiveStr2=nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return SettingPlayerTitle
|
return SettingPlayerTitle
|
|
@ -43,7 +43,7 @@ function PlayerLiveView:New(gameObject,_Type, PlayerLiveViewData,orginLayer)
|
||||||
--立绘对象
|
--立绘对象
|
||||||
instance.rideLive = nil
|
instance.rideLive = nil
|
||||||
instance.playerLive = nil
|
instance.playerLive = nil
|
||||||
instance.titleLive = nil
|
instance.titleLive = SubUIManager.Open(SubUIConfig.PlayerTitle, instance.titleLiveGo.transform)
|
||||||
--立绘资源名字
|
--立绘资源名字
|
||||||
instance.rideLiveStr = ""
|
instance.rideLiveStr = ""
|
||||||
instance.playerLiveStr = ""
|
instance.playerLiveStr = ""
|
||||||
|
@ -64,7 +64,6 @@ function PlayerLiveView:New(gameObject,_Type, PlayerLiveViewData,orginLayer)
|
||||||
end
|
end
|
||||||
--初始化组件(用于子类重写)
|
--初始化组件(用于子类重写)
|
||||||
function PlayerLiveView:InitComponent()
|
function PlayerLiveView:InitComponent()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--绑定事件(用于子类重写)
|
--绑定事件(用于子类重写)
|
||||||
|
@ -96,6 +95,14 @@ function PlayerLiveView:OnOpen(scale,pos,dir)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local sortingorder=0
|
local sortingorder=0
|
||||||
|
|
||||||
|
function PlayerLiveView:OnSortingOrderChange(sortingOrder)
|
||||||
|
if self.titleLive then
|
||||||
|
self.titleLive:SetLayer(sortingOrder)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--加载三个立绘(称号 坐骑 皮肤)
|
--加载三个立绘(称号 坐骑 皮肤)
|
||||||
function PlayerLiveView:OnShowLive()
|
function PlayerLiveView:OnShowLive()
|
||||||
-- LogBlue("self.rideLiveGo "..self.rideLiveGo.name)
|
-- LogBlue("self.rideLiveGo "..self.rideLiveGo.name)
|
||||||
|
@ -110,10 +117,6 @@ function PlayerLiveView:OnShowLive()
|
||||||
poolManager:UnLoadLive(self.playerLiveStr, self.playerLive, PoolManager.AssetType.GameObject)
|
poolManager:UnLoadLive(self.playerLiveStr, self.playerLive, PoolManager.AssetType.GameObject)
|
||||||
self.playerLive = nil
|
self.playerLive = nil
|
||||||
end
|
end
|
||||||
if self.titleLive then
|
|
||||||
poolManager:UnLoadAsset(self.titleLiveStr, self.titleLive, PoolManager.AssetType.GameObject)
|
|
||||||
self.titleLive = nil
|
|
||||||
end
|
|
||||||
--时装
|
--时装
|
||||||
if self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0 then
|
if self.PlayerLiveViewData.skin and self.PlayerLiveViewData.skin > 0 then
|
||||||
self.playerLiveGo:SetActive(true)
|
self.playerLiveGo:SetActive(true)
|
||||||
|
@ -161,17 +164,7 @@ function PlayerLiveView:OnShowLive()
|
||||||
y=y+3
|
y=y+3
|
||||||
end
|
end
|
||||||
local curLocalPosition = Vector3.New(curArtResourcesConfig.Position[1],y,0)
|
local curLocalPosition = Vector3.New(curArtResourcesConfig.Position[1],y,0)
|
||||||
self.titleLiveStr = curArtResourcesConfig.Name--GetResourcePath(ConfigManager.GetConfigData(ConfigName.PlayerAppearance,PlayerManager.designation).Live)
|
self.titleLive:SetShow(self.PlayerLiveViewData.designation, curLocalPosition, curArtResourcesConfig.Scale, curArtResourcesConfig.Scale* self.transform.localScale.x, self.orginLayer)
|
||||||
self.titleLive = poolManager:LoadAsset(self.titleLiveStr, PoolManager.AssetType.GameObject)
|
|
||||||
self.titleLive.transform:SetParent(self.titleLiveGo.transform)
|
|
||||||
self.titleLive.transform.localPosition = curLocalPosition
|
|
||||||
self.titleLive.transform.localScale = curLocalScale
|
|
||||||
if self.orginLayer then
|
|
||||||
LogError("self.orginlayer "..self.orginLayer.."sortingOrder "..sortingorder)
|
|
||||||
Util.SetParticleSortLayer(self.titleLive,self.orginLayer)
|
|
||||||
--sortingorder = self.orginLayer
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function PlayerLiveView:SetNameHeight(hei)
|
function PlayerLiveView:SetNameHeight(hei)
|
||||||
|
@ -311,15 +304,13 @@ function PlayerLiveView:OnClose()
|
||||||
poolManager:UnLoadLive(self.playerLiveStr, self.playerLive, PoolManager.AssetType.GameObject)
|
poolManager:UnLoadLive(self.playerLiveStr, self.playerLive, PoolManager.AssetType.GameObject)
|
||||||
self.playerLive = nil
|
self.playerLive = nil
|
||||||
end
|
end
|
||||||
if self.titleLive then
|
|
||||||
poolManager:UnLoadAsset(self.titleLiveStr, self.titleLive, PoolManager.AssetType.GameObject)
|
|
||||||
self.titleLive = nil
|
|
||||||
end
|
|
||||||
if self.leader then
|
if self.leader then
|
||||||
poolManager:UnLoadAsset("PlayerLiveView",self.leader, PoolManager.AssetType.GameObject)
|
poolManager:UnLoadAsset("PlayerLiveView",self.leader, PoolManager.AssetType.GameObject)
|
||||||
self.leader = nil
|
self.leader = nil
|
||||||
end
|
end
|
||||||
|
if self.titleLive then
|
||||||
|
SubUIManager.Close(self.titleLive)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--判断动画是否存在
|
--判断动画是否存在
|
||||||
|
|
|
@ -0,0 +1,108 @@
|
||||||
|
PlayerTitle = {}
|
||||||
|
local this=PlayerTitle
|
||||||
|
local mapNpcOp = "PlayerTitle"
|
||||||
|
|
||||||
|
function PlayerTitle:New(gameObject)
|
||||||
|
local b = {}
|
||||||
|
b.gameObject = gameObject
|
||||||
|
b.transform = gameObject.transform
|
||||||
|
setmetatable(b, { __index = PlayerTitle })
|
||||||
|
return b
|
||||||
|
end
|
||||||
|
--初始化组件(用于子类重写)
|
||||||
|
function PlayerTitle:InitComponent()
|
||||||
|
self.layer = 0
|
||||||
|
self.canvas = self.gameObject:GetComponent("Canvas")
|
||||||
|
end
|
||||||
|
|
||||||
|
--绑定事件(用于子类重写)
|
||||||
|
function PlayerTitle:BindEvent()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
--添加事件监听(用于子类重写)
|
||||||
|
function PlayerTitle:AddListener()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
--移除事件监听(用于子类重写)
|
||||||
|
function PlayerTitle:RemoveListener()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
--界面打开时调用(用于子类重写)
|
||||||
|
function PlayerTitle:OnOpen(itemId, position, scale, layer)
|
||||||
|
if itemId then
|
||||||
|
self:SetShow(itemId, position, scale, layer)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function PlayerTitle:SetShow(itemId, position, scale, effectScale, layer)
|
||||||
|
self:ClearTitle()
|
||||||
|
|
||||||
|
local curPlayerRole = ConfigManager.GetConfigData(ConfigName.PlayerRole,itemId)
|
||||||
|
local curArtResourcesConfig = ConfigManager.GetConfigData(ConfigName.ArtResourcesConfig,curPlayerRole.LiveAnimName)
|
||||||
|
self.curTitleName = curArtResourcesConfig.Name
|
||||||
|
self.titleLive = poolManager:LoadAsset(self.curTitleName, PoolManager.AssetType.GameObject)
|
||||||
|
self.titleLive.transform:SetParent(self.canvas.transform)
|
||||||
|
|
||||||
|
if position then
|
||||||
|
self:SetPostion(position)
|
||||||
|
end
|
||||||
|
if scale then
|
||||||
|
self:SetScale(scale)
|
||||||
|
end
|
||||||
|
if effectScale then
|
||||||
|
self:SetEffectScale(effectScale)
|
||||||
|
end
|
||||||
|
if layer then
|
||||||
|
self:SetLayer(layer)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function PlayerTitle:SetPostion(position)
|
||||||
|
if self.titleLive then
|
||||||
|
self.titleLive.transform.localPosition = position
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function PlayerTitle:SetScale(scale)
|
||||||
|
if self.titleLive then
|
||||||
|
self.titleLive.transform.localScale = Vector3.one * scale
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function PlayerTitle:SetEffectScale(effectScale)
|
||||||
|
if self.titleLive then
|
||||||
|
Util.SetParticleScale(self.titleLive, effectScale)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function PlayerTitle:SetLayer(layer)
|
||||||
|
local _layer = layer + 10
|
||||||
|
if self.titleLive then
|
||||||
|
Util.AddParticleSortLayer(self.titleLive, _layer - self.layer)
|
||||||
|
end
|
||||||
|
if self.canvas then
|
||||||
|
self.canvas.overrideSorting = true
|
||||||
|
self.canvas.sortingOrder = _layer
|
||||||
|
end
|
||||||
|
self.layer = _layer
|
||||||
|
end
|
||||||
|
|
||||||
|
function PlayerTitle:ClearTitle()
|
||||||
|
if self.titleLive then
|
||||||
|
destroy(self.titleLive)
|
||||||
|
end
|
||||||
|
self.titleLive = nil
|
||||||
|
self.curTitleName = nil
|
||||||
|
self.layer = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
--界面销毁时调用(用于子类重写)
|
||||||
|
function PlayerTitle:OnClose()
|
||||||
|
self:ClearTitle()
|
||||||
|
end
|
||||||
|
|
||||||
|
return PlayerTitle
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e31794c072cdb5e4bba6a0ce30c47286
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Loading…
Reference in New Issue