Improved copying of components

This commit is contained in:
Simon Lübeß
2024-03-17 20:28:41 +01:00
parent a2c7bf7d06
commit 930d289565
3 changed files with 40 additions and 5 deletions
@@ -9,6 +9,13 @@ using Mono;
namespace GlitchyEngine.World
{
/// Components that implement this interface provide custom copy logic.
interface ICopyComponent<T>
{
/// Copies the data from source to target.
concrete static void Copy(T* source, T* target);
}
[AttributeUsage(.Struct, .ReflectAttribute, ReflectUser=.Methods | .NonStaticFields)]
struct ComponentAttribute : Attribute
{