Example #1
0
 public void Call(string name = null)
 {
     LuaSandbox.Sandbox(Lua, () =>
     {
         _function.Call(name);
     });
 }
Example #2
0
        public static LuaSandbox CreateSandbox(Lua thread, string initialDirectory)
        {
            var sandbox = new LuaSandbox();

            SandboxForThread.Add(thread, sandbox);
            sandbox.SetSandboxCurrentDirectory(initialDirectory);
            return(sandbox);
        }
Example #3
0
 public static LuaSandbox CreateSandbox(Lua thread, string initialDirectory)
 {
     var sandbox = new LuaSandbox();
     SandboxForThread.Add(thread, sandbox);
     sandbox.SetSandboxCurrentDirectory(initialDirectory);
     sandbox.SetLogger(DefaultLogger);
     return sandbox;
 }
Example #4
0
        public void DetachFromScript()
        {
            var thread = new Lua();

            // Current dir will have to do for now, but this will inevitably not be desired
            // Users will expect it to be the same directly as the thread that spawned this callback
            // But how do we know what that directory was?
            LuaSandbox.CreateSandbox(thread, ".");
            LuaFile = new LuaFile(".")
            {
                Thread = thread
            };
        }