Adding dependency tracking.
diff --git a/Source/Actor.cpp b/Source/Actor.cpp
index 69a750e..4c64de9 100644
--- a/Source/Actor.cpp
+++ b/Source/Actor.cpp
@@ -143,6 +143,18 @@
 	// m_Flags |= Flags.IsDirty;
 }
 
+bool Actor::addDependency(ActorComponent* a, ActorComponent* b)
+{
+	auto dependents = a->dependents();
+	if(std::find(dependents.begin(), dependents.end(), b) != dependents.end())
+	{
+		// Already contained.
+		return false;
+	}
+	dependents.push_back(b);
+	return true;
+}
+
 void Actor::eventCallback(ActorAnimationEvent::Callback callback, void* userdata)
 {
 	m_EventCallbackUserData = userdata;
@@ -501,6 +513,9 @@
 			}
 		}
 	}
+
+	// Todo: Add complete resolve.
+	sortDependencies();
 }
 
 static bool DrawOrderComparer(ActorRenderNode* a, ActorRenderNode* b)
@@ -617,6 +632,9 @@
 			std::sort(m_Solvers, m_Solvers + m_SolverNodeCount, SolverComparer);
 		}
 	}
+
+	// Todo: add complete resolve.
+	sortDependencies();
 }
 
 const int Actor::nestedActorCount() const
diff --git a/Source/Actor.hpp b/Source/Actor.hpp
index 043438f..7521382 100644
--- a/Source/Actor.hpp
+++ b/Source/Actor.hpp
@@ -114,6 +114,7 @@
 			void load(unsigned char* bytes, unsigned int length);
 			void load(const std::string& filename);
 			void setFilename(const std::string& filename);
+			bool addDependency(ActorComponent* a, ActorComponent* b);
 
 			unsigned int componentCount() const;
 			ActorComponent* component(unsigned int index) const;
diff --git a/Source/ActorComponent.cpp b/Source/ActorComponent.cpp
index 4a0eb64..a4bc548 100644
--- a/Source/ActorComponent.cpp
+++ b/Source/ActorComponent.cpp
@@ -1,3 +1,4 @@
+#include "Actor.hpp"
 #include "ActorComponent.hpp"
 #include "ActorNode.hpp"
 #include "CustomProperty.hpp"
@@ -59,12 +60,16 @@
 void ActorComponent::resolveComponentIndices(ActorComponent** components)
 {
 	ActorComponent* component = components[m_ParentIdx];
-	if(component != nullptr && component->isNode())
+	if(component != nullptr)
 	{
-		m_Parent = static_cast<ActorNode*>(component);
-		if(this->isNode())
+		m_Actor->addDependency(this, component);
+		if(component->isNode())
 		{
-			m_Parent->addChild(static_cast<ActorNode*>(this));
+			m_Parent = static_cast<ActorNode*>(component);
+			if(this->isNode())
+			{
+				m_Parent->addChild(static_cast<ActorNode*>(this));
+			}
 		}
 	}
 }
diff --git a/Source/ActorComponent.hpp b/Source/ActorComponent.hpp
index 8dafe7e..edced6a 100644
--- a/Source/ActorComponent.hpp
+++ b/Source/ActorComponent.hpp
@@ -50,6 +50,7 @@
 			std::vector<CustomFloatProperty*> m_CustomFloatProperties;
 			std::vector<CustomStringProperty*> m_CustomStringProperties;
 			std::vector<CustomBooleanProperty*> m_CustomBooleanProperties;
+			std::vector<ActorComponent*> m_Dependents;
 
 		private:
 			unsigned short m_ParentIdx;
@@ -84,6 +85,7 @@
 			CustomFloatProperty* getCustomFloatProperty(const std::string& name);
 			CustomStringProperty* getCustomStringProperty(const std::string& name);
 			CustomBooleanProperty* getCustomBooleanProperty(const std::string& name);
+			std::vector<ActorComponent*>& dependents() { return m_Dependents; }
 	};
 }
 #endif
\ No newline at end of file
diff --git a/Source/DependencySorter.cpp b/Source/DependencySorter.cpp
index 5640925..bc27613 100644
--- a/Source/DependencySorter.cpp
+++ b/Source/DependencySorter.cpp
@@ -23,17 +23,14 @@
 
     m_Temp.emplace(component);
 
-    // IList<ActorComponent> dependents = n.m_Dependents;
-    // if(dependents != null)
-    // {
-    //     foreach(ActorComponent d in dependents)
-    //     {
-    //         if(!visit(d, order))
-    //         {
-    //             return false;
-    //         }
-    //     }
-    // }
+    auto dependents = component->dependents();
+    for(auto dependent : dependents)
+    {
+        if(!visit(dependent, order))
+        {
+            return false;
+        }
+    }
     m_Perm.emplace(component);
     order.insert(order.begin(), component);