From 886ce2fe3d03d7b31887949cd3432250424a3c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Sat, 11 Sep 2021 16:57:16 +0200 Subject: [PATCH] Added basic AnimationComponent --- GlitchyEngine/src/World/AnimationComponent.bf | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 GlitchyEngine/src/World/AnimationComponent.bf diff --git a/GlitchyEngine/src/World/AnimationComponent.bf b/GlitchyEngine/src/World/AnimationComponent.bf new file mode 100644 index 0000000..e656144 --- /dev/null +++ b/GlitchyEngine/src/World/AnimationComponent.bf @@ -0,0 +1,30 @@ +using GlitchyEngine.Renderer.Animation; + +namespace GlitchyEngine.World +{ + struct AnimationComponent : IDisposableComponent + { + private AnimationClip _animationClip; + + public AnimationClip AnimationClip + { + get => _animationClip; + set mut + { + if(_animationClip == value) + return; + + _animationClip?.ReleaseRef(); + _animationClip = value; + _animationClip?.AddRef(); + } + } + + public static void DisposeComponent(void* component) + { + Self* animationComponent = (Self*)component; + + animationComponent._animationClip?.ReleaseRef(); + } + } +}