Example #1
0
        public void Run()
        {
            var assembly = typeof(Sample).GetTypeInfo().Assembly;

            using (Stream stream = assembly.GetManifestResourceStream("GwenNetLua.Sample.Lua.Sample.lua"))
            {
                DynValue result = Run("GwenNetLua.Sample.Lua.Sample.lua", stream);
                if (result.Type == DataType.UserData)
                {
                    Control.ListBox textOutput = result.UserData.Object as Control.ListBox;
                    if (textOutput != null)
                    {
                        script.Options.DebugPrint = t => { textOutput.AddRow(t); textOutput.ScrollToBottom(); }
                    }
                    ;
                }
            }

            foreach (var res in assembly.GetManifestResourceNames())
            {
                if (res != "GwenNetLua.Sample.Lua.Sample.lua" && res.Contains(".lua"))
                {
                    using (Stream stream = assembly.GetManifestResourceStream(res))
                    {
                        Run(res, stream);
                    }
                }
            }
        }
 public void PrintText(string str)
 {
     m_TextOutput.AddRow(str);
     m_TextOutput.ScrollToBottom();
 }