UnityTransform.js 1008 B

1234567891011121314151617181920212223242526
  1. import {Il2cppHackerApi} from "../hacker/Il2cppHackerApi";
  2. import {log, logHHex} from "../../logger";
  3. import {ProcessUtils} from "../../sausage/utils/ProcessUtils";
  4. import {UnityObject} from "./UnityObject";
  5. import {UnityVector3} from "./UnityVector3";
  6. export class UnityTransform extends UnityObject {
  7. get_localPosition() {
  8. let methodAddr = Il2cppHackerApi.getMethodAddr("UnityEngine.CoreModule.dll", "UnityEngine",
  9. "Transform", "get_localPosition", 0);
  10. let nativeFunction = new NativeFunction(methodAddr, "pointer", ['pointer']);
  11. return nativeFunction(this);
  12. }
  13. get_position() {
  14. let methodAddr = Il2cppHackerApi.getMethodAddr("UnityEngine.CoreModule.dll", "UnityEngine",
  15. "Transform", "get_position", 0);
  16. log("get_position:" + (methodAddr - ProcessUtils.getAddr()).toString(16));
  17. let nativeFunction = new NativeFunction(methodAddr, "float", ['pointer']);
  18. let s = nativeFunction(this);
  19. return s;
  20. }
  21. }