(RealStatePtr L)
| 600 | |
| 601 | #if !XLUA_GENERAL |
| 602 | [MonoPInvokeCallback(typeof(LuaCSFunction))] |
| 603 | internal static int Print(RealStatePtr L) |
| 604 | { |
| 605 | try |
| 606 | { |
| 607 | int n = LuaAPI.lua_gettop(L); |
| 608 | string s = String.Empty; |
| 609 | |
| 610 | if (0 != LuaAPI.xlua_getglobal(L, "tostring")) |
| 611 | { |
| 612 | return LuaAPI.luaL_error(L, "can not get tostring in print:"); |
| 613 | } |
| 614 | |
| 615 | for (int i = 1; i <= n; i++) |
| 616 | { |
| 617 | LuaAPI.lua_pushvalue(L, -1); /* function to be called */ |
| 618 | LuaAPI.lua_pushvalue(L, i); /* value to print */ |
| 619 | if (0 != LuaAPI.lua_pcall(L, 1, 1, 0)) |
| 620 | { |
| 621 | return LuaAPI.lua_error(L); |
| 622 | } |
| 623 | s += LuaAPI.lua_tostring(L, -1); |
| 624 | |
| 625 | if (i != n) s += "\t"; |
| 626 | |
| 627 | LuaAPI.lua_pop(L, 1); /* pop result */ |
| 628 | } |
| 629 | UnityEngine.Debug.Log("LUA: " + s); |
| 630 | return 0; |
| 631 | } |
| 632 | catch (System.Exception e) |
| 633 | { |
| 634 | return LuaAPI.luaL_error(L, "c# exception in print:" + e); |
| 635 | } |
| 636 | } |
| 637 | #endif |
| 638 | |
| 639 | #if (!UNITY_SWITCH && !UNITY_WEBGL) || UNITY_EDITOR |
nothing calls this directly
no test coverage detected