【log】manager lateupdate 报错添加一些提示
parent
0b5c529de4
commit
b95a511dc2
|
@ -265,14 +265,22 @@ end
|
||||||
|
|
||||||
local isPcall = true
|
local isPcall = true
|
||||||
--用于查找错误用
|
--用于查找错误用
|
||||||
function MyPCall(func)
|
function MyPCall(func, ...)
|
||||||
if not isPcall then
|
if not isPcall then
|
||||||
func()
|
func()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local flag, msg = pcall(func)
|
local flag, msg = pcall(func)
|
||||||
if not flag then
|
if not flag then
|
||||||
Util.LogError(msg)
|
LogError(msg)
|
||||||
|
local args = unpack(...)
|
||||||
|
if #args > 0 then
|
||||||
|
local s = ""
|
||||||
|
for k, v in ipairs(args) do
|
||||||
|
s = s .. "|" .. tostring(v)
|
||||||
|
end
|
||||||
|
LogRed("error params:"..s)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -19,10 +19,10 @@ function Game.Initialize()
|
||||||
end
|
end
|
||||||
|
|
||||||
--初始化管理器
|
--初始化管理器
|
||||||
|
local managers = require("Common/Managers")
|
||||||
function Game.InitManagers()
|
function Game.InitManagers()
|
||||||
Log("===============>初始化管理器")
|
Log("===============>初始化管理器")
|
||||||
Framework.Initialize()
|
Framework.Initialize()
|
||||||
local managers = require("Common/Managers")
|
|
||||||
this.managerList = {}
|
this.managerList = {}
|
||||||
for i, v in ipairs(managers) do
|
for i, v in ipairs(managers) do
|
||||||
this.managerList[i] = require("Modules/"..v)
|
this.managerList[i] = require("Modules/"..v)
|
||||||
|
@ -39,7 +39,7 @@ end
|
||||||
function Game.LateUpdate()
|
function Game.LateUpdate()
|
||||||
for i, v in ipairs(this.managerList) do
|
for i, v in ipairs(this.managerList) do
|
||||||
if v.LateUpdate then
|
if v.LateUpdate then
|
||||||
MyPCall(v.LateUpdate)
|
MyPCall(v.LateUpdate, managers[i])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue