コード例 #1
0
ファイル: LuaFunction.cs プロジェクト: ZeroToken/MyTools
 public LuaFunction(int reference, LuaState interpreter)
 {            
     _Reference = reference;
     this.function = null;
     _Interpreter = interpreter;
     L = _Interpreter.L;
     translator = _Interpreter.translator;            
 }
コード例 #2
0
ファイル: LuaFunction.cs プロジェクト: ZeroToken/MyTools
 public LuaFunction(LuaCSFunction function, LuaState interpreter)
 {
     _Reference = 0;
     this.function = function;
     _Interpreter = interpreter;
     L = _Interpreter.L;
     translator = _Interpreter.translator;            
 }
コード例 #3
0
ファイル: LuaManager.cs プロジェクト: ZeroToken/MyTools
        public LuaManager()
        {
            mLuastate = new LuaState();
            foreach (var script in LuaConfig.DefaultScripts)
                this.DoResourceFile(script);
            this.AddGlobalFunction("AddSearchPath", luaState.GetFunction("AddSearchPath"));
            this.AddSearchPath(LuaConfig.ScriptAssetsPath);

        }
コード例 #4
0
ファイル: LuaBase.cs プロジェクト: ZeroToken/MyTools
        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;
            }
        }