Hello. I’m creating a online card game using MVC… or at least I’m trying.
I’m using Unity 5 Network and I succeed to connect players and separate what each player is able to do.
So I have a model with all of my data, on the server only,
a view representing the model with gameobjects, on both client and server,
and a controller manipulating data depending of the player.
But I don’t really know how to send the model data between server and clients this way, and we probably can’t send object references. Where do I have to begin ?
What I am trying to do is that each player has a different view synchronised on the same model.
On the server, I succeed to display the model on the view. But I don’t know how to view the same model on the client view.
write code that syncs your model data between the server and client, and they each can render their view however they want based on the model state. if you’re using sync vars, you can have a hook for each sync var that’s ran when the var changes. you could dispatch an event or something that your controller can catch and then tell the view to redraw.
honestly though, i wouldn’t religiously stick to MVC when using Unet. just go with the flow!