Hi,
First of all, I’m sorry for my bad english. I’m wondering which is the best way to implement the MVC architecture pattern in Unity. I’m newbie on using this software but I’ve some experience in the programming world.
At first, I suppose I need to create an empty GameObject with the main controller script in an empty scene . This controller, should request for each view / scene / level in the game with Application.loadLevel. With this, the controller is gonna be destroyed, so I need to tell in Awake() to DontDestroyOnLoad(this).
But, how can the controller handle the inputs received in the view? The view, needs to send a request to controller, telling him: “the user has clicked this button of mine”. In this case, the controller is defined in, for example, Scene0, and the view in Scene01. If I try to GetComponet() from the View, Unity says me he can’t get the controller instance.
Can you give me a little example of this architecture pattern working?
Thanks a lot