Open XUCharles opened 5 days ago
targetMethod.invoke(speed) => this.method("SetSpeed").invoke(speed)
targetMethod.invoke(speed) => this.method("SetSpeed").invoke(speed)
thanks!! it works
targetMethod.invoke(speed) => this.method("SetSpeed").invoke(speed)
if the speed or the res is not a float type but a UnityEngine.Vector3 such as (2.3 ,2 ,4). how can i modify it.
i try:
var res = this.method("SetSpeed").invoke()
res.x = xxx
return res
or
var modifiedRes = new Il2Cpp.ValueType(res.handle)
modifiedRes.x = xxx
return modifiedRes
just does't work
modifiedRes.field('x').value = xxx
modifiedRes.field('x').value = xxx
it help. thanks
you're welcome
i want to implementation a no-static function。 eg:
Il2Cpp.perform(() => { const assembly = Il2Cpp.domain.assembly("Test.GameLogic"); const targetClass = assembly.image.class("TFramework.GameLogic.BattleCharacterMovementComponent"); const targetMethod = targetClass.method("SetSpeed"); targetMethod.implementation = function (speed){ console.log("speed", speed) //speed = ptr(30) res = targetMethod.invoke(speed) return res } } this function is System.Void SetSpeed(System.Single speed), a no-static function。 i just want to invoke this function or modify the parameters of the function. but throw a error il2cpp: cannot invoke non-static method SetSpeed as it must be invoked throught a Il2Cpp.Object, not a Il2Cpp.Class. how can i implement it