summaryrefslogtreecommitdiff
path: root/Runtime/Animation/AnimationManager.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-08-14 22:50:43 +0800
committerchai <chaifix@163.com>2019-08-14 22:50:43 +0800
commit15740faf9fe9fe4be08965098bbf2947e096aeeb (patch)
treea730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Animation/AnimationManager.h
+Unity Runtime codeHEADmaster
Diffstat (limited to 'Runtime/Animation/AnimationManager.h')
-rw-r--r--Runtime/Animation/AnimationManager.h39
1 files changed, 39 insertions, 0 deletions
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<Animation>& node) { m_Animations.push_back(node); }
+ void AddFixed (ListNode<Animation>& 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<Animation> > AnimationList;
+
+ AnimationList m_Animations;
+ AnimationList m_FixedAnimations;
+};
+
+AnimationManager& GetAnimationManager ();
+
+#endif