You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
C#: Avoid GodotSharp as project assembly name
The name GodotSharp conflicts with the name of the Godot assembly, this causes the project assembly to be ignored.
This commit is contained in:
@@ -208,4 +208,23 @@ String relative_to(const String &p_path, const String &p_relative_to) {
|
||||
return relative_to_impl(path_abs_norm, relative_to_abs_norm);
|
||||
}
|
||||
|
||||
String get_csharp_project_name() {
|
||||
String name = GLOBAL_GET("mono/project/assembly_name");
|
||||
if (name.empty()) {
|
||||
name = GLOBAL_GET("application/config/name");
|
||||
name = OS::get_singleton()->get_safe_dir_name(name);
|
||||
}
|
||||
|
||||
if (name.empty()) {
|
||||
name = "UnnamedProject";
|
||||
}
|
||||
|
||||
// Avoid reserved names that conflict with Godot assemblies.
|
||||
if (name == "GodotSharp" || name == "GodotSharpEditor") {
|
||||
name += "_";
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
} // namespace path
|
||||
|
||||
Reference in New Issue
Block a user