GlobalFunctions = GlobalFunctions or {} function ShowNotice(info) local uiControllerPath = "UI/Public/SUINoticeText.lua" require("Base/UIHelper.lua"):OpenUI(uiControllerPath) require(uiControllerPath).NoticeInfo(info) end function ShowDialogOK(tips) local uiControllerPath = "UI/Public/SUIDialogOKPanel.lua" require("Base/UIHelper.lua"):OpenUI(uiControllerPath) require(uiControllerPath).SetInfo(tips) end function ShowDialogConfirm(tips, confirmFunction, cancelFunction) local uiControllerPath = "UI/Public/SUIDialogConfirmPanel.lua" require("Base/UIHelper.lua"):OpenUI(uiControllerPath) require(uiControllerPath).SetInfo(tips, confirmFunction, cancelFunction) end function Debug(...) CS.UnityEngine.Debug.Log(...) end function Debugf(format, ...) CS.UnityEngine.Debug.Log(string.format(format, ...)) end function Warn(...) CS.UnityEngine.Debug.LogWarning(...) end function Warnf(format, ...) CS.UnityEngine.Debug.LogWarning(string.format(format, ...)) end function LoadResource(resPath) --Warnf("---- ----> isEditor: %s Path: %s", tostring(CS.UnityEngine.Application.isEditor), resPath) if CS.UnityEngine.Application.isEditor == true then return CS.SFramework.SResourceManagerE.LoadResource(resPath) else return CS.SFramework.SResourceManagerR.LoadResource(resPath) end end local function __TRACKBACK__(szErrorMsg) local szTrackText = debug.traceback(tostring(szErrorMsg), 6); print("---------------------------------------- TRACKBACK ----------------------------------------"); print(szTrackText, "LUA ERROR"); print("---------------------------------------- TRACKBACK ----------------------------------------"); local szExceptionText = "LUA EXCEPTION\n" .. szTrackText; --[[Error("---------------------------------------- TRACKBACK ----------------------------------------"); Error(szTrackText .. " LUA ERROR"); Error("---------------------------------------- TRACKBACK ----------------------------------------"); Error(szExceptionText)]] CS.UnityEngine.Debug.LogWarning(szExceptionText) return false; end function SafeCall(fnFunc, ...) local tArgs = { ... }; return xpcall(function() return fnFunc(table.unpack(tArgs)) end, __TRACKBACK__); end