I have an assignment to implement strict MVC pattern in Unity3d.
I have no problem in doing it in any low level environment but I do have a problem wrapping my head around doing it in Unity.
What I did is:
Class GameplayController : MonoBehaviour
that creates and contains:
GameplayModel - loads prefabs, moves them around
GameplayView - loads textures and ui
(which do not derive from MonoBehaviour)
and I put the GameplayController on camera.
Is that a good way to do it ?
if so: how do I communicate with other scripts like collisionDetection on objects ?
Model maybee the hold game logic(game rule,ect…),pure logic…
View maybee how to display the game logic in visual.
Controller comunicate model and view…one game model can have may views (games)
In every MVC I’ve ever used, the model contains just the data, and the controller is responsible for logic, presenting only calculated values to the View (no logic in view).
I’m more than happy to help (how often do I post in this forum? - You should know this). But I’m not willing to do someone’s school assignment for them. There’s a difference in my mind, that’s all.