public LuaFunction(int reference, LuaState interpreter) { _Reference = reference; this.function = null; _Interpreter = interpreter; L = _Interpreter.L; translator = _Interpreter.translator; }
public LuaFunction(LuaCSFunction function, LuaState interpreter) { _Reference = 0; this.function = function; _Interpreter = interpreter; L = _Interpreter.L; translator = _Interpreter.translator; }
public LuaManager() { mLuastate = new LuaState(); foreach (var script in LuaConfig.DefaultScripts) this.DoResourceFile(script); this.AddGlobalFunction("AddSearchPath", luaState.GetFunction("AddSearchPath")); this.AddSearchPath(LuaConfig.ScriptAssetsPath); }
public virtual void Dispose(bool disposeManagedResources) { if (!_Disposed) { if (_Reference != 0 && _Interpreter != null) { if (disposeManagedResources) { _Interpreter.dispose(_Reference); _Reference = 0; } else if (_Interpreter.L != IntPtr.Zero) { LuaScriptMgr.refGCList.Enqueue(new LuaRef(_Interpreter.L, _Reference)); _Reference = 0; } } _Interpreter = null; _Disposed = true; } }