From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/Animation/AnimationManager.h | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Runtime/Animation/AnimationManager.h (limited to 'Runtime/Animation/AnimationManager.h') diff --git a/Runtime/Animation/AnimationManager.h b/Runtime/Animation/AnimationManager.h new file mode 100644 index 0000000..51c9ff3 --- /dev/null +++ b/Runtime/Animation/AnimationManager.h @@ -0,0 +1,39 @@ +#ifndef ANIMATIONMANAGER_H +#define ANIMATIONMANAGER_H + +#include "Runtime/Utilities/LinkedList.h" + +class Animation; + +class AnimationManager +{ + public: + + static void InitializeClass (); + static void CleanupClass (); + + /// Animates all registered objects according to the registered parameters + /// Removes Animations if the animated object or the track is gone or if the time + /// of the track end time of the animation is reached + void Update (); + + public: + + void AddDynamic(ListNode& node) { m_Animations.push_back(node); } + void AddFixed (ListNode& node) { m_FixedAnimations.push_back(node); } + +#if ENABLE_PROFILER + int GetUpdatedAnimationCount () { return m_Animations.size_slow() + m_FixedAnimations.size_slow(); } +#endif + + private: + + typedef List< ListNode > AnimationList; + + AnimationList m_Animations; + AnimationList m_FixedAnimations; +}; + +AnimationManager& GetAnimationManager (); + +#endif -- cgit v1.1-26-g67d0