30 lines
1.5 KiB
Lua
30 lines
1.5 KiB
Lua
-- One named widget per heartbeat, no page/gameplay calls or assembly scan.
|
|||
|
|
do
|
||
|
|
local s=_G.__gacPingWidgetCapture1 or {index=1};_G.__gacPingWidgetCapture1=s
|
||
|
|
local paths={
|
||
|
|
'UIRoot/Page/MazeMainPage(Clone)/RightTopArea/NetStatusPanel/NetStatusPanel(Clone)',
|
||
|
|
'UIRoot/Page/BattleGamePhaseUI(Clone)/FunctionArea/NetStatusPanel/NetStatusPanel',
|
||
|
|
}
|
||
|
|
if s.index<=#paths then
|
||
|
|
local path=paths[s.index];s.index=s.index+1
|
||
|
|
local function log(v)CS.UnityEngine.Debug.Log('[GAC_PING_WIDGET] '..v)end
|
||
|
|
local ok,err=pcall(function()
|
||
|
|
local root=CS.UnityEngine.GameObject.Find(path)
|
||
|
|
log('ROOT '..path..' found='..tostring(root~=nil))
|
||
|
|
if not root then return end
|
||
|
|
local graphics=root:GetComponentsInChildren(typeof(CS.UnityEngine.UI.Graphic),true)
|
||
|
|
log('COUNT '..tostring(graphics.Length))
|
||
|
|
for i=0,math.min(graphics.Length-1,23)do
|
||
|
|
local g=graphics[i];local t=g.transform;local chain={t.name}
|
||
|
|
while t.parent and t.gameObject~=root do t=t.parent;table.insert(chain,1,t.name)end
|
||
|
|
local line='GRAPHIC '..table.concat(chain,'/')..' type='..tostring(g:GetType().FullName)..' active='..tostring(g.gameObject.activeInHierarchy)
|
||
|
|
local rect=g.rectTransform.rect
|
||
|
|
line=line..' size='..tostring(rect.width)..','..tostring(rect.height)
|
||
|
|
pcall(function()line=line..' sprite='..tostring(g.sprite and g.sprite.name)..' imageType='..tostring(g.type)end)
|
||
|
|
pcall(function()line=line..' text='..tostring(g.text)..' rich='..tostring(g.supportRichText)end)
|
||
|
|
log(line)
|
||
|
|
end
|
||
|
|
end)
|
||
|
|
if not ok then log('ERROR '..tostring(err))end
|
||
|
|
end
|
||
|
|
end
|