@@ -10,7 +10,7 @@ public class LuaConsole : EditorWindow
1010{
1111 #region COMMON_DEFINE
1212const string COMMON_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
8888end})
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
9595end
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()
103103end
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()
111111end
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
123123end
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
134134end
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" ) ]
441441static void PushComponentObjectToLua ( MenuCommand cmd )
442442{
443- Component tf = cmd . context as Component ;
444- if ( tf == null )
443+ Component com = cmd . context as Component ;
444+ if ( com == null )
445445return ;
446446
447447LuaState luaState = LuaState . main ;
448448if ( luaState == null )
449449return ;
450450
451- LuaObject . pushObject ( luaState . L , tf ) ;
451+ LuaObject . pushObject ( luaState . L , com ) ;
452452LuaDLL . lua_setglobal ( luaState . L , "_" ) ;
453453}
454454