diff --git a/app/src/main/cpp/GakumasLocalify/camera/baseCamera.cpp b/app/src/main/cpp/GakumasLocalify/camera/baseCamera.cpp index 0c7b837..beb4a8e 100644 --- a/app/src/main/cpp/GakumasLocalify/camera/baseCamera.cpp +++ b/app/src/main/cpp/GakumasLocalify/camera/baseCamera.cpp @@ -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; diff --git a/app/src/main/cpp/deps/UnityResolve/UnityResolve.hpp b/app/src/main/cpp/deps/UnityResolve/UnityResolve.hpp index 7aacda4..3bb6631 100644 --- a/app/src/main/cpp/deps/UnityResolve/UnityResolve.hpp +++ b/app/src/main/cpp/deps/UnityResolve/UnityResolve.hpp @@ -526,7 +526,10 @@ public: if (!address_.contains(funcName) || !address_[funcName]) address_[funcName] = static_cast(GetProcAddress(static_cast(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(this); return {}; } + + auto GetPixelRect() -> Rect { + if (!this) return {}; + static Method* method; + if (!method) method = Get("UnityEngine.CoreModule.dll")->Get("Camera")->Get("get_pixelRect"); + return method->Invoke(this); + } + auto GetOrthographicSize() -> float { + if (!this) return {}; + static Method* method; + if (!method) method = Get("UnityEngine.CoreModule.dll")->Get("Camera")->Get("get_orthographicSize"); + return method->Invoke(this); + } }; struct Transform : Component { diff --git a/app/src/main/java/io/github/chinosk/gakumas/localify/hookUtils/FilesChecker.kt b/app/src/main/java/io/github/chinosk/gakumas/localify/hookUtils/FilesChecker.kt index 13369cc..055ed2f 100644 --- a/app/src/main/java/io/github/chinosk/gakumas/localify/hookUtils/FilesChecker.kt +++ b/app/src/main/java/io/github/chinosk/gakumas/localify/hookUtils/FilesChecker.kt @@ -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(