【log】manager lateupdate 报错添加一些提示

dev_chengFeng
gaoxin 2021-06-07 10:38:47 +08:00
parent 0b5c529de4
commit b95a511dc2
2 changed files with 12 additions and 4 deletions

View File

@ -265,14 +265,22 @@ end
local isPcall = true
--用于查找错误用
function MyPCall(func)
function MyPCall(func, ...)
if not isPcall then
func()
return
end
local flag, msg = pcall(func)
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

View File

@ -19,10 +19,10 @@ function Game.Initialize()
end
--初始化管理器
local managers = require("Common/Managers")
function Game.InitManagers()
Log("===============>初始化管理器")
Framework.Initialize()
local managers = require("Common/Managers")
this.managerList = {}
for i, v in ipairs(managers) do
this.managerList[i] = require("Modules/"..v)
@ -39,7 +39,7 @@ end
function Game.LateUpdate()
for i, v in ipairs(this.managerList) do
if v.LateUpdate then
MyPCall(v.LateUpdate)
MyPCall(v.LateUpdate, managers[i])
end
end
end