Files
GaCy-GO/tools/cw_node_battle_schema.lua
T

34 lines
1.5 KiB
Lua

-- Read only named CW stage/node metadata, one object per heartbeat.
do
local state=_G.__gacCwNodeBattleSchema1 or {index=1};_G.__gacCwNodeBattleSchema1=state
if state.done then return end
local log=function(v)CS.UnityEngine.Debug.Log('[GAC_CW_NODE_BATTLE] '..tostring(v))end
local ok,err=pcall(function()
local flags=CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),60)
local session=CS.RPG.Client.GlobalVars.s_ModuleManager.GridFightModule.CurGameSession
if not session then return end
if not state.objects then
local fields=session:GetType():GetFields(flags)
for i=0,math.min(fields.Length-1,63)do
local f=fields[i]
if f.FieldType.FullName=='RPG.Client.GridFightStage'then
local stage=f:GetValue(session)
if stage and stage.CurNode then state.objects={stage,stage.CurNode}end
end
end
if not state.objects then return end
end
local value=state.objects[state.index];if not value then log('END');state.done=true;return end
state.index=state.index+1
local t=value:GetType();log('TYPE '..t.FullName)
local fs=t:GetFields(flags)
for i=0,math.min(fs.Length-1,47)do log('FIELD '..tostring(fs[i]))end
local ps=t:GetProperties(flags)
for i=0,math.min(ps.Length-1,47)do log('PROPERTY '..tostring(ps[i]))end
local ms=t:GetMethods(flags)
for i=0,math.min(ms.Length-1,95)do if ms[i].DeclaringType==t then log('METHOD '..tostring(ms[i]))end end
if state.index==3 then log('END');state.done=true end
end)
if not ok then log('ERROR '..tostring(err));state.done=true end
end