Ejemplo n.º 1
0
        public static void Run(string script, object target)
        {
            var bindings = new ScriptBindings(target);

            Basic = new BasicScriptRunner(bindings);
            Basic.Run(script);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a MoonSharp script with bindings
        /// </summary>
        /// <param name="bindings"></param>
        /// <returns></returns>
        public static Script CreateBoundScript(ScriptBindings bindings = null, CoreModules modules = CoreModules.Preset_HardSandbox | CoreModules.Coroutine | CoreModules.OS_Time)
        {
            Script script = new Script(modules);

            GlobalScriptBindings.Initialize(script);
            bindings.Initialize(script);
            return(script);
        }
Ejemplo n.º 3
0
 public HookedStateScriptRunner(LuaScriptStandard standard, ScriptBindings bindings = null) : this()
 {
     bindings.Initialize(Lua);
     ScriptStandard = standard;
 }
 public MultiHookedScriptRunner(ScriptBindings bindings, LuaScriptStandard standard = null) : this()
 {
     bindings.Initialize(Lua);
     ScriptStandard = standard;
 }
 public void RemoveBindings(ScriptBindings bindings)
 {
     bindings.CleanFunctions(Lua);
 }
 public void AddBindings(ScriptBindings bindings)
 {
     bindings.Initialize(Lua);
 }
        public BasicScriptRunner(params Action[] actions) : this()
        {
            ScriptBindings b = new ScriptBindings(actions);

            b.Initialize(Lua);
        }
        public BasicScriptRunner(params Delegate[] dels) : this()
        {
            ScriptBindings b = new ScriptBindings(dels);

            b.Initialize(Lua);
        }
 public BasicScriptRunner(ScriptBindings bindings) : this()
 {
     bindings.Initialize(Lua);
 }
Ejemplo n.º 10
0
 public static void Run(string script, ScriptBindings bindings)
 {
     Basic = new BasicScriptRunner();
     Basic.AddBindings(bindings);
     Basic.Run(script);
 }