-
Notifications
You must be signed in to change notification settings - Fork 220
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
Get Dictionary values #595
Comments
It's a const AssemblyCSharp = Il2Cpp.domain.assembly("Assembly-CSharp").image;
const GameManager = AssemblyCSharp.class("GameManager");
// @ts-ignore
GameManager.method("OpenLevel").implementation = function (this: Il2Cpp.Object | Il2Cpp.Class, level: any): any {
const adjustConversationLevels = this.field<Il2Cpp.Object>("adjustConversationLevels").value;
// do whatever you want with adjustConversationLevels, it's a Il2Cpp.Object
// let's print its class
console.log(adjustConversationLevels.class);
return this.method("OpenLevel", 1).invoke(level);
}; |
Thank you but I mean adjustConversationLevels contain the values I wanna get but I don't know how to get those |
its a object of
to get/set/add/resize etc... just read the class things. eg:
and call it in script. to iterate it you can use
ex to iterate: const enumerator = adjustConversationLevels.method("GetEnumerator").Invoke<Il2Cpp.ValueType>();
while (enumerator.method("MoveNext").invoke<bool>())
{
const current = enumerator.method("get_Current").invoke<Il2Cpp.ValueType>();
const key = current.method("get_Key").invoke<int>(); // as the key type is "int" according to your dump
const value = current.method("get_Value").invoke<Il2Cpp.String>(); // as the value type is "string" according to your dump
// just use console.log to read values in your console
} |
I'm trying to get the values of this field
It's
System.Collections.Generic.Dictionary`2[System.Int32,System.String]
and this is my code
but there's no Il2Cpp.Dictionary so how to get those values?
The text was updated successfully, but these errors were encountered: