I\'ve been experimenting with making a component based system similar to Unity\'s, but in C++. I\'m wondering how the GetComponent() method that Unity implement
I know this post is already answered, but if you look into Game Programming Patterns, in this book he has a design pattern called Service Locator, and at the end, it says Unity uses this pattern together with the Component Pattern. I wish I could answer into more specifics, but this could be another way to approach this.