An interpreter for the Lua language, written entirely in C# for the .NET, Mono, Xamarin and Unity3D platforms, including handy remote debugger facilities.
public static class ExtMethods
{
public static void Test1(this MyClass c) { Debug.Log("test1"); }
public static void Test2(this MyClass c) { Debug.Log("test2"); }
public static void Test3(this MyClass c) { Debug.Log("test3"); }
}
public class MyClass
{
public MyClass() { }
}
public class Scripts
{
Script _script = new Script();
string _myScript =
"local a = Class()" +
"a.Test1()" +
"a.Test2()" +
"a.Test3()" +
public void InitScript()
{
UserData.RegisterExtensionType(typeof(ExtMethods));
UserData.RegisterType(typeof(MyClass));
_script.Globals["Class"] = typeof(MyClass)
_script.DoString(_myScript);
}
}
it only cache just first method of ExtensionType
local a = Class()
a.Test1() -- cache success
a.Test2() -- failed
a.Test3() -- failed
ExtensionType
has cache issue?it only cache just first method of ExtensionType