Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commited9dcf5

Browse files
committed
fix bug for LuaConsole
1 parent82c0e2d commited9dcf5

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

‎Assets/Slua/Editor/LuaConsole.cs‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class LuaConsole : EditorWindow
1010
{
1111
#region COMMON_DEFINE
1212
conststringCOMMON_DEFINE=@"
13-
localprettyTabToStr =function(tab, level, path, visited)
13+
local function prettyTabToStr(tab, level, path, visited)
1414
local result = ''
1515
if level == nil then
1616
visited = {}
@@ -86,30 +86,30 @@ public class LuaConsole : EditorWindow
8686
print('set global', k, '=', v)
8787
_G[k] = v
8888
end})
89-
localprintVar =function(val)
89+
local function printVar(val)
9090
if type(val) == 'table' then
9191
print(prettyTabToStr(val))
9292
else
9393
print(val)
9494
end
9595
end
96-
localeval =function(code)
96+
local function eval(code)
9797
local func,err = loadstring('return ' .. code)
9898
if not func then
9999
error(err)
100100
end
101101
setfenv(func, env)
102102
return func()
103103
end
104-
localcompile =function(code)
104+
local function compile(code)
105105
local func,err = loadstring('do ' .. code .. ' end')
106106
if not func then
107107
error(err)
108108
end
109109
setfenv(func, env)
110110
func()
111111
end
112-
localprintExpr =function(str)
112+
local function printExpr(str)
113113
if str:match('^[_%a][_%w]*$') then
114114
printVar(env[str])
115115
else
@@ -121,7 +121,7 @@ public class LuaConsole : EditorWindow
121121
end
122122
end
123123
end
124-
localdir =function(val)
124+
local function dir(val)
125125
if type(val) == 'table' then
126126
local t = {}
127127
for k,v in pairs(val)do
@@ -132,7 +132,7 @@ public class LuaConsole : EditorWindow
132132
print(val)
133133
end
134134
end
135-
localdirExpr =function(str)
135+
local function dirExpr(str)
136136
if str:match('^[_%a][_%w]*$') then
137137
dir(env[str])
138138
else
@@ -440,15 +440,15 @@ void DoCommand(string str)
440440
[MenuItem("CONTEXT/Component/Push Component To Lua")]
441441
staticvoidPushComponentObjectToLua(MenuCommandcmd)
442442
{
443-
Componenttf=cmd.contextasComponent;
444-
if(tf==null)
443+
Componentcom=cmd.contextasComponent;
444+
if(com==null)
445445
return;
446446

447447
LuaStateluaState=LuaState.main;
448448
if(luaState==null)
449449
return;
450450

451-
LuaObject.pushObject(luaState.L,tf);
451+
LuaObject.pushObject(luaState.L,com);
452452
LuaDLL.lua_setglobal(luaState.L,"_");
453453
}
454454

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp