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

Chaining Extension Methods only works after running the script again #328

Open
EthanSK opened this issue Oct 13, 2023 · 0 comments
Open

Comments

@EthanSK
Copy link

EthanSK commented Oct 13, 2023

The first time I run this

` RegisterAllExtensionMethods();

    string tempstr = @"
        local a = Vector3(0,1,2).WithX(6969).WithY(555).WithZ(666)           
        print('le vec',a)
     ";
    DynValue res = Script.DoString(tempstr);

`

It gives error ScriptRuntimeException: cannot access field WithY of userdata<UnityEngine.Vector3>

and the next time i run it in the same unity play session, I get

ScriptRuntimeException: cannot access field WithZ of userdata<UnityEngine.Vector3>

and then running it any subsequent time works.

It doesn't matter how many times I call RegisterAllExtensionMethods(), what seems to matter is how many times DoScript was called. It's like every time it runs the script, it adds to some user data a level of chaining thats supported...

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