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

what is replacement for IL2CPP.Object::fields that can spit out all fields regardless of class/struct? #501

Open
WimpyMistake opened this issue Apr 1, 2024 · 0 comments

Comments

@WimpyMistake
Copy link

in the old version 0.6.7, we have this kind of code

for (const field of object.fields) {
    const fieldValue = field.value as number;
    console.log(fieldValue)
}

that eventually can give you values of all fields.

But starting from 0.7.0, the fields was removed, and have to explicitly specify the field name first.

But my use case is to get all the fields regardless of the Object is class or struct.

For a class I could get by doing this:

for (const f of object.class.fields) {
    const field = object.field(f.name);
}

But if the object is a struct, object.class would be undefined

I'm using version 0.9.0.

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