Exemple #1
0
        public AutoHookedScriptRunner(string script)
        {
            Lua = new Script(CoreModules.Preset_HardSandbox | CoreModules.Coroutine | CoreModules.OS_Time);
            LoadScript(script);

            GlobalScriptBindings.Initialize(Lua);
        }
Exemple #2
0
 public static void RegisterYielder <T>(string name = null) where T : Yielder
 {
     if (name == null)
     {
         name = typeof(T).Name;
     }
     GlobalScriptBindings.RegisterYieldableType(name, typeof(T));
     allYielders[name] = typeof(T);
 }
Exemple #3
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);
        }
Exemple #4
0
 public BasicScriptRunner()
 {
     lua = new Script(CoreModules.Preset_HardSandbox | CoreModules.Coroutine | CoreModules.OS_Time);
     GlobalScriptBindings.Initialize(lua);
 }