using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using LuaInterface;
/// <summary>
/// made by zyc
/// </summary>
public class MyCallLuaFunction : MonoBehaviour {
LuaState lua;
LuaFunction func;
// Use this for initialization
void Start () {
lua = new LuaState();
lua.DoString(@"function max(a,b)
if (a>b) then
return a;
else
return b;
end
end");
func = lua.GetFunction("max");
object[] objs= func.Call(100,101);
Debug.Log(objs[0]);
lua.CheckTop();
lua.Dispose();
}
}
Ulua function2
最新推荐文章于 2021-07-02 10:07:36 发布