Skip to content

AnisLahouar/Unity-AMVC-Design-Pattern

 
 

Repository files navigation

AMVC for UI Unity projects

The best architecture to create Unity project based on Canvas and is flexible enough to be implemented even on top of ECS or OOP.

This is a sample project I have made to demonstrate the AMVC architecture. It consists of two scene:

  1. Loading Scene : when we send few requests to fill our models with the necessary data. The loading system based on Command Design Pattern to make it flexible when we need to reload or skip some thing or even to handle errors more efficiently. the DataBaseManager is a helper class built to integrate the Rest Client for Unity plugin into the AMVC architecture.
  2. Main Scene : I consume the Api result with two different ways to explain how the Controller (Systems) and Views (Panels) communicate.

Also you will notice that all my UI Panels are canvases. and the reason to use multiple canvases is to avoid regenerating the meshes when UI elements change. Read More about it

The Application Model View Controller (AMVC) solve any dependencies issues by spliting the software into :

  • Single entry point "Application" : contain and manage all critical instances and application-related data.
  • Three major components:
  1. Models : Data CRUD.
  2. Views : UI Panels.
  3. Controllers : Application systems.

Amvc

Single Entry Point

entryPt

Dependencies

all panels and systems are accessible from anywhere using GetPanel<T> and GetSystem<T> respectively. Get

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%