You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-23 15:16:17 +00:00
C#: Load assemblies directly from PCK on Android
Assemblies are now loaded directly from the PCK (`res://`) instead of a cache directory. This prevents runtime failures that occurred when the OS cleared cached files (e.g., under low storage), ensuring the required assemblies are always available.
This commit is contained in:
@@ -169,6 +169,10 @@ private:
|
|||||||
String arch = Engine::get_singleton()->get_architecture_name();
|
String arch = Engine::get_singleton()->get_architecture_name();
|
||||||
String appname_safe = Path::get_csharp_project_name();
|
String appname_safe = Path::get_csharp_project_name();
|
||||||
String packed_path = "res://.godot/mono/publish/" + arch;
|
String packed_path = "res://.godot/mono/publish/" + arch;
|
||||||
|
#ifdef ANDROID_ENABLED
|
||||||
|
api_assemblies_dir = packed_path;
|
||||||
|
print_verbose(".NET: Android platform detected. Setting api_assemblies_dir directly to pck path: " + api_assemblies_dir);
|
||||||
|
#else
|
||||||
if (DirAccess::exists(packed_path)) {
|
if (DirAccess::exists(packed_path)) {
|
||||||
// The dotnet publish data is packed in the pck/zip.
|
// The dotnet publish data is packed in the pck/zip.
|
||||||
String data_dir_root = OS::get_singleton()->get_cache_path().path_join("data_" + appname_safe + "_" + platform + "_" + arch);
|
String data_dir_root = OS::get_singleton()->get_cache_path().path_join("data_" + appname_safe + "_" + platform + "_" + arch);
|
||||||
@@ -214,6 +218,7 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
api_assemblies_dir = data_dir_root;
|
api_assemblies_dir = data_dir_root;
|
||||||
}
|
}
|
||||||
|
#endif // ANDROID_ENABLED
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user