You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a situation where a node could be an Area2D or a PhysicsBody2D. These two classes each individually implement collision_layer and collision_mask, even though they are the only children of their direct parent, CollisionLayer2D. This is fine for GDScript, but causes issues in a compiled language like C#.
Looking at the code for Area2D and PhysicsBody2D, it looks like the getters/setters are pretty much identical. Can this logic be refactored out to their shared parent? Removing duplicated code would also improve the maintainability of the engine.
The text was updated successfully, but these errors were encountered:
JarLowrey
changed the title
Difficult to work with Area2D/PhysicsBody2D in C# due to duplicated code
Difficult to work with Area2D/PhysicsBody2D in C# due to duplicated code in Godot Engine
Mar 6, 2019
Removing the topic:mono label as this is an issue with the Godot API. What is proposed here is for CollisionLayer2D to declare collision_layer and collision_mask, instead of doing that in their two derived classes.
Godot version:
3.0.6
Issue description:
I have a situation where a node could be an Area2D or a PhysicsBody2D. These two classes each individually implement collision_layer and collision_mask, even though they are the only children of their direct parent, CollisionLayer2D. This is fine for GDScript, but causes issues in a compiled language like C#.
Looking at the code for Area2D and PhysicsBody2D, it looks like the getters/setters are pretty much identical. Can this logic be refactored out to their shared parent? Removing duplicated code would also improve the maintainability of the engine.
The text was updated successfully, but these errors were encountered: