Open choldi opened 1 year ago
Gaqme.Core.DatabaseSystem.HeroSheet -> Game.Core.DatabaseSystem.HeroSheet
use ret.field
const PackRecord = mscorlib.class("Gaqme.Core.DatabaseSystem.HeroSheet"); // @ts-ignore PackRecord.method("GetData").implementation = function():Il2Cpp.Object { const ret:Il2Cpp.Object=this.method("GetData").invoke
(); console.log("Data:", ret.ID, ret.Name); return ret;
Thanks @ralcore but I get these compile error:
0:34:32 - File change detected. Starting incremental compilation...
agent/index.ts(18,19): error TS2322: Type 'ReturnType' is not assignable to type 'Object'.
Type 'number' is not assignable to type 'Object'.
agent/index.ts(18,73): error TS2558: Expected 0 type arguments, but got 1.
0:34:32 - Found 2 errors. Watching for file changes.
Line 18 is the call to the original method. This happened also before correct the object name :
const ret:Il2Cpp.Object=this.method("GetData").invoke<Il2Cpp.Object>();
missed that, object generic type is applied to method not invoke - this.method("GetData").invoke
Thanks again @ralcore Compile right now but the funcion seems not to be called. Perhaps the implementation it is not been called because is a new implementation.
The original GetData() returns Game.Core.DatabaseSystem.DataSheet.DataRecord instance The GetData() in my implementation returns a generic Il2Cpp.Object
Could I implement with onEnter and OnLeave? How can I rewrite?
Still a long way ahead to learn for me...
this Il2Cpp.Object would contain Game.Core.DatabaseSystem.DataSheet.DataRecord as the library does not generate bindings and every object is Il2Cpp.Object
I have this classes:
And I want to overrride the GetData method. I've tried this, but gives me error.
How can I translate the c# class Game.Core.DatabaseSystem.DataSheet.DataRecord to TS and receive this data and return this data?