Implementing Component system from Unity in c++

后端 未结 4 1687
有刺的猬
有刺的猬 2020-12-04 18:23

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

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-04 19:14

    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.

提交回复
热议问题