Exemplo n.º 1
0
        public LuaMain()
        {
            LuaVM = new LuaVirtualMachine();

            // we don't have to register them on level load because this is a global singleton, not a level one
            RegisterLuaFunctions(this);
            // though we do have to restart lua when we change levels
            LevelManager.OnLevelLoad +=
                (e) => {
                    Restart();
                };

            LuaVM.Lua.DoString("print(\"All working over here!\")");
            Launch.Log("[Loading] Lua engine successfully started!");
        }
Exemplo n.º 2
0
        /// <summary>
        /// Quits, disposes, and creates a new Lua VM, then runs the re-registration event.
        /// </summary>
        public void Restart()
        {
            Quit();
            LuaVM.Lua.Dispose();

            LuaVM = new LuaVirtualMachine();
            RunRegisterEvent();
        }
Exemplo n.º 3
0
 public void InitVirtualMachine()
 {
     LUA = new LuaVirtualMachine(1, null, new LuaFunctionRepository(), Proxy);
 }