- Home /
Correct way to decouple model from view for gameobjects
Hi everyone.
I have a game where each object has a model derived from WorldObject which doesnt not inheirit from monobehaviour. These hold all the objects state, and its function.
Then a seperate set of classes, all derived from WorldObjectViewer represent these objects in the game and store a reference to to, listen to events etc.
My question is, what is the cleanest way to read through the list of WorldObjects I have, and instantiate each one with their appropriate WorldObjectViewer. I dont want the model objects to know about the viewers.
Help appreciated!
Your answer
![](https://koobas.hobune.stream/wayback/20220612121519im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Several Questions about MVC pattern 0 Answers
Component based architecture Unit, AI, Health, Attack 0 Answers
Silly question, doing nothing? 4 Answers
Why is ECS better than actual Unity Entity-Component pattern ? 1 Answer