Beispiel #1
0
 public LuaWrapper()
 {
     lua.SetDebugHook(NLua.Event.EventMasks.LUA_MASKLINE, 1);
     lua.LoadCLRPackage();
     Scriptmgr = ScriptHelpMgr.Instance;
     RegistAllFunction();
 }
Beispiel #2
0
        private void SetInitialState()
        {
            State = new NLua.Lua();
            State.LoadCLRPackage();
            State.DoString(@"import ('World','World.ToyWorldCore')");
            State.DoString(@"import ('World','World.Lua')");

            State["le"]    = this;
            State["atlas"] = m_atlas;

            State.RegisterFunction("Help", typeof(LuaExecutor).GetMethod("Help"));

            if (m_atlas.Avatars.Count > 0)
            {
                AvatarCommander avatarCommander = new AvatarCommander(this, m_atlas);
                State["ac"] = avatarCommander;
            }

            AtlasManipulator atlasManipulator = new AtlasManipulator(m_atlas);

            State["am"] = atlasManipulator;

            State["lc"] = m_luaConsole;

            State.DebugHook += OnDebugHook;

            State.SetDebugHook(EventMasks.LUA_MASKLINE, 1000);
        }