修复部分模拟器无效/崩溃的问题

This commit is contained in:
chinosk
2024-05-23 21:27:02 +08:00
parent 808e3532fc
commit b120acabfe
3 changed files with 22 additions and 2 deletions

View File

@@ -526,7 +526,10 @@ public:
if (!address_.contains(funcName) || !address_[funcName]) address_[funcName] = static_cast<void*>(GetProcAddress(static_cast<HMODULE>(hmodule_), funcName.c_str()));
#elif ANDROID_MODE || LINUX_MODE
if (address_.find(funcName) == address_.end() || !address_[funcName]) {
address_[funcName] = xdl_sym(hmodule_, funcName.c_str(), NULL);
auto xdlAddr = xdl_sym(hmodule_, funcName.c_str(), NULL);
if (!xdlAddr) {
address_[funcName] = dlsym(hmodule_, funcName.c_str());
}
}
#endif
@@ -1797,6 +1800,19 @@ public:
if (method) return method->Invoke<Matrix4x4>(this);
return {};
}
auto GetPixelRect() -> Rect {
if (!this) return {};
static Method* method;
if (!method) method = Get("UnityEngine.CoreModule.dll")->Get("Camera")->Get<Method>("get_pixelRect");
return method->Invoke<Rect>(this);
}
auto GetOrthographicSize() -> float {
if (!this) return {};
static Method* method;
if (!method) method = Get("UnityEngine.CoreModule.dll")->Get("Camera")->Get<Method>("get_orthographicSize");
return method->Invoke<float>(this);
}
};
struct Transform : Component {