1
0

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

This commit is contained in:
chinosk 2024-05-23 21:27:02 +08:00
parent 808e3532fc
commit b120acabfe
No known key found for this signature in database
GPG Key ID: 00610B08C1BF7BE9
3 changed files with 22 additions and 2 deletions

View File

@ -7,7 +7,7 @@ namespace BaseCamera {
float moveStep = 0.05;
float look_radius = 5; // 转向半径
float moveAngel = 1.5; // 转向角度
float moveAngel = 1; // 转向角度
int smoothLevel = 1;
unsigned long sleepTime = 0;

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 {

View File

@ -33,6 +33,10 @@ object FilesChecker {
fun updateFiles() {
Log.i("GakumasLocal", "Updating files...")
val pluginBasePath = File(filesDir, localizationFilesDir)
if (!pluginBasePath.exists()) {
pluginBasePath.mkdirs()
}
val assets = XModuleResources.createInstance(modulePath, null).assets
fun forAllAssetFiles(