Пример #1
0
        public void Run()
        {
            string file = Cache.runPath + "script\\lua\\test1.lua";
            string fun  = "Main";
            //var bl = eng.Load(file, fun);
            int param1 = 1;
            int param2 = 2;
            int param3 = 3;

            var ret = eng.Run(file, fun, param1, param2, param3);

            Console.WriteLine(ret.ToJson());
            ret = eng.Run(file, fun, param1, param2, param3);
            Console.WriteLine(ret.ToJson());
            Assert.IsTrue(ret != null);
        }
Пример #2
0
        /// <summary>
        /// 执行脚本
        /// </summary>
        public static void Run()
        {
            string file = Cache.runPath + "script\\lua\\test1.lua";
            string fun  = "Main";
            //var bl = eng.Load(file, fun);
            int param1 = 1;
            int param2 = 2;
            int param3 = 3;

            var ret = eng.Run(file, fun, param1, param2, param3);

            Console.WriteLine(ret);
            Console.WriteLine(eng.Ex);
            ret = eng.Run(file, fun, param1, param2, param3);
            Console.WriteLine(ret);
            Console.WriteLine(eng.Ex);
            Console.WriteLine("Run结果:" + (ret != null));
        }