Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache issue Userdata.ExtensionType? #305

Open
vin-spiegel opened this issue Apr 13, 2022 · 0 comments
Open

Cache issue Userdata.ExtensionType? #305

vin-spiegel opened this issue Apr 13, 2022 · 0 comments

Comments

@vin-spiegel
Copy link

ExtensionType has cache issue?

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant