Пример #1
0
        public HookedStateScriptRunner()
        {
            Lua = new Script(CoreModules.Preset_HardSandbox | CoreModules.Coroutine | CoreModules.OS_Time);

            Lua.Globals["RegisterHook"]      = (Action <DynValue, string>)RegisterHook;
            Lua.Globals["RegisterCoroutine"] = (Action <DynValue, string, bool>)RegisterCoroutine;
            Lua.Globals["RemoveHook"]        = (Action <string>)RemoveHook;
            Lua.Globals["MakeGlobal"]        = (Action <string>)MakeGlobal;
            Lua.Globals["RemoveGlobal"]      = (Action <string>)RemoveGlobal;
            Lua.Globals["ResetGlobals"]      = (Action)ResetGlobals;

            //Global init
            GlobalScriptBindings.Initialize(Lua);
            GlobalScriptBindings.InitializeYieldables(Lua);
        }