-
Notifications
You must be signed in to change notification settings - Fork 14
MVC
We use a pretty traditional approach for handling views:
MVCManager is a storage of controllers and an entry for showing a particular view.
WindowStackManager provides capabilities for maintaining stacks for different view types. It's sub-ordinate to MVCManager and should not be used outside of it.
The sorting layer defines how the corresponding view behaves in the Windows Stack. For each type, there is a different unique logic under the hood:
-
Persistentviews are always rendered behind everything else and once shown can't be hidden. They are rendered in the same order and should not overlap.-
Minimapis a good example of aPersistentView.
-
-
Fullscreenviews are rendered in front of thePersistentlayer.- When a
Fullscreenview is pushed into the stack allPopupsget hidden and allPersistentviews getBlurred. - When a
Fullscreenview closes allPersistentviews receiveFocus
- When a
-
Popup- There could be several
Popupsin the stack. The next popup pushed is drawn above the previous one -
Popupreceives aBlursignal when it gets obscured by a newPopup; andFocuswhen it becomes the highest in the hierarchy - There is a special
IPopupCloserViewthat exists in a single copy and provides the capability of closing the top-most pop-up by clicking on the background
- There could be several
-
Overlayviews are always drawn above every other view.- When the
Overlayis pushed it hidesFullscreenandPopupviews - When the
Overlayis popped no automatic recovery for hidden views is performed
- When the
To show a view a respective ShowCommand<TView, TInputData> should be passed into the UniTask ShowAsync<TView, TInputData>(ShowCommand<TView, TInputData> command) method.
Controller is bound with a view type and input arguments' type one to one: thus, to prevent argument mismatch IssueCommand(TInputData inputData) from the typed Controller should be used, e.g.:
mvcManager.ShowAsync(ExplorePanelController.IssueCommand(new ExplorePanelParameter(ExploreSections.Navmap))).Forget()