【称号】显示优化
parent
208f9ec119
commit
61be59d1f3
|
@ -453,6 +453,7 @@ 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
|
||||||
|
@ -487,6 +488,27 @@ 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
|
||||||
|
|
|
@ -196,7 +196,7 @@ end
|
||||||
function SettingInfo:OnSortingOrderChange()
|
function SettingInfo:OnSortingOrderChange()
|
||||||
-- 头像层级
|
-- 头像层级
|
||||||
if this.playerHead then
|
if this.playerHead then
|
||||||
this.playerHead:SetLayer(self.sortingOrder)
|
this.playerHead:SetLayer(this.rootPanel.sortingOrder)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function SettingInfo:OnShowData()
|
function SettingInfo:OnShowData()
|
||||||
|
|
|
@ -18,9 +18,9 @@ this.contents = {
|
||||||
[1] = {view = require("Modules/Setting/SettingInfo"), panelName = "settingInfo"},
|
[1] = {view = require("Modules/Setting/SettingInfo"), panelName = "settingInfo"},
|
||||||
--称号
|
--称号
|
||||||
-- [2] = {view = require("Modules/Setting/SettingPlayerTitle"), panelName = "settingPlayerTitle"},
|
-- [2] = {view = require("Modules/Setting/SettingPlayerTitle"), panelName = "settingPlayerTitle"},
|
||||||
--时装
|
-- 时装
|
||||||
[2] = {view = require("Modules/Setting/SettingPlayerRide"), panelName = "settingPlayerRide"},
|
[2] = {view = require("Modules/Setting/SettingPlayerRide"), panelName = "settingPlayerRide"},
|
||||||
--坐骑
|
-- 称号
|
||||||
[3] = {view = require("Modules/Setting/SettingPlayerTitle"), panelName = "settingPlayerTitle"},
|
[3] = {view = require("Modules/Setting/SettingPlayerTitle"), panelName = "settingPlayerTitle"},
|
||||||
--[4] = {view = require("Modules/Setting/SettingPlayerSkin"), panelName = "settingPlayerSkin"},
|
--[4] = {view = require("Modules/Setting/SettingPlayerSkin"), panelName = "settingPlayerSkin"},
|
||||||
}
|
}
|
||||||
|
@ -93,6 +93,15 @@ function SettingPanel:OnOpen(index)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function SettingPanel:OnSortingOrderChange()
|
||||||
|
for i = 1, #this.contents do
|
||||||
|
if this.contents[i].view.OnSortingOrderChange then
|
||||||
|
this.contents[i].view:OnSortingOrderChange(self.sortingOrder)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
||||||
-- function SettingPanel:OnShow()
|
-- function SettingPanel:OnShow()
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,10 @@ function SettingPlayerTitle:ctor(mainPanel, gameObject)
|
||||||
end
|
end
|
||||||
local titleLive
|
local titleLive
|
||||||
local titleLive2
|
local titleLive2
|
||||||
local sortingorder = 0
|
local titleLiveCanvas
|
||||||
local sortingorder2 = 0
|
local titleLiveCanvas2
|
||||||
|
local _sortingorder = 0
|
||||||
|
|
||||||
local titleLiveStr
|
local titleLiveStr
|
||||||
local titleLiveStr2
|
local titleLiveStr2
|
||||||
local curUserRideId
|
local curUserRideId
|
||||||
|
@ -162,8 +164,6 @@ function this.ShowRideInfo(go,data)
|
||||||
|
|
||||||
end
|
end
|
||||||
function this.SingleRideClickShowInfo(data,go)
|
function this.SingleRideClickShowInfo(data,go)
|
||||||
sortingorder=0
|
|
||||||
sortingorder2=0
|
|
||||||
curPlayerHeadIconConfig = data
|
curPlayerHeadIconConfig = data
|
||||||
if go then
|
if go then
|
||||||
this.setImage:SetActive(true)
|
this.setImage:SetActive(true)
|
||||||
|
@ -203,11 +203,13 @@ function this.SingleRideClickShowInfo(data,go)
|
||||||
ride =0,
|
ride =0,
|
||||||
}
|
}
|
||||||
if titleLive then
|
if titleLive then
|
||||||
poolManager:UnLoadAsset(titleLiveStr, titleLive, PoolManager.AssetType.GameObject)
|
-- 特效大小修改后无法还原,所以直接删除
|
||||||
|
destroy(titleLive)
|
||||||
titleLive = nil
|
titleLive = nil
|
||||||
end
|
end
|
||||||
if titleLive2 then
|
if titleLive2 then
|
||||||
poolManager:UnLoadAsset(titleLiveStr2, titleLive2, PoolManager.AssetType.GameObject)
|
-- 特效大小修改后无法还原,所以直接删除
|
||||||
|
destroy(titleLive2)
|
||||||
titleLive2 = nil
|
titleLive2 = nil
|
||||||
end
|
end
|
||||||
live2dRoot = PlayerLiveView:New(this.live2dRootParent,2, curPlayerLiveViewData)
|
live2dRoot = PlayerLiveView:New(this.live2dRootParent,2, curPlayerLiveViewData)
|
||||||
|
@ -221,9 +223,13 @@ function this.SingleRideClickShowInfo(data,go)
|
||||||
titleLive.transform:SetParent(this.live2dRootParent.transform)
|
titleLive.transform:SetParent(this.live2dRootParent.transform)
|
||||||
titleLive.transform.localPosition = Vector3.New(0,150,0)
|
titleLive.transform.localPosition = Vector3.New(0,150,0)
|
||||||
titleLive.transform.localScale = Vector3.New(0.5,0.5,0.5)
|
titleLive.transform.localScale = Vector3.New(0.5,0.5,0.5)
|
||||||
Util.AddParticleSortLayer(titleLive,this.rootPanel.sortingOrder - sortingorder2)
|
Util.SetParticleScale(titleLive, 0.5)
|
||||||
sortingorder2 = this.rootPanel.sortingOrder
|
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 curPlayerRole = ConfigManager.GetConfigData(ConfigName.PlayerRole,data.ItemId)
|
||||||
|
@ -233,8 +239,13 @@ function this.SingleRideClickShowInfo(data,go)
|
||||||
titleLive2.transform:SetParent(this.live2dRootParent2.transform)
|
titleLive2.transform:SetParent(this.live2dRootParent2.transform)
|
||||||
titleLive2.transform.localPosition = Vector3.New(0,0,0)
|
titleLive2.transform.localPosition = Vector3.New(0,0,0)
|
||||||
titleLive2.transform.localScale = Vector3.New(1,1,1)
|
titleLive2.transform.localScale = Vector3.New(1,1,1)
|
||||||
Util.AddParticleSortLayer(titleLive2,this.rootPanel.sortingOrder - sortingorder)
|
Util.SetParticleScale(titleLive2, 1)
|
||||||
sortingorder = this.rootPanel.sortingOrder
|
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
|
||||||
|
@ -256,9 +267,27 @@ function this.SingleRideClickShowInfo(data,go)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 界面层级变动
|
||||||
|
function SettingPlayerTitle:OnSortingOrderChange(sortingOrder)
|
||||||
|
local titleSort = sortingOrder + 10
|
||||||
|
if titleLive then
|
||||||
|
Util.AddParticleSortLayer(titleLive, titleSort - _sortingorder)
|
||||||
|
end
|
||||||
|
if titleLive2 then
|
||||||
|
Util.AddParticleSortLayer(titleLive2, titleSort - _sortingorder)
|
||||||
|
end
|
||||||
|
if titleLiveCanvas then
|
||||||
|
titleLiveCanvas.sortingOrder = titleSort
|
||||||
|
end
|
||||||
|
if titleLiveCanvas2 then
|
||||||
|
titleLiveCanvas2.sortingOrder = titleSort
|
||||||
|
end
|
||||||
|
_sortingorder = titleSort
|
||||||
|
end
|
||||||
|
|
||||||
--界面关闭时调用(用于子类重写)
|
--界面关闭时调用(用于子类重写)
|
||||||
function SettingPlayerTitle:OnClose()
|
function SettingPlayerTitle:OnClose()
|
||||||
|
|
||||||
if live2dRoot then
|
if live2dRoot then
|
||||||
live2dRoot:OnClose()
|
live2dRoot:OnClose()
|
||||||
end
|
end
|
||||||
|
@ -269,9 +298,12 @@ end
|
||||||
|
|
||||||
--界面销毁时调用(用于子类重写)
|
--界面销毁时调用(用于子类重写)
|
||||||
function SettingPlayerTitle:OnDestroy()
|
function SettingPlayerTitle:OnDestroy()
|
||||||
|
_sortingorder = 0
|
||||||
this.spLoader:Destroy()
|
this.spLoader:Destroy()
|
||||||
titleLive=nil
|
titleLive=nil
|
||||||
titleLive2=nil
|
titleLive2=nil
|
||||||
|
titleLiveCanvas = nil
|
||||||
|
titleLiveCanvas2 = nil
|
||||||
titleLiveStr=nil
|
titleLiveStr=nil
|
||||||
titleLiveStr2=nil
|
titleLiveStr2=nil
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue