You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Assets/UIManager/README.md
+9-12
Original file line number
Diff line number
Diff line change
@@ -7,28 +7,25 @@ The UI Manager is a stack-based UI controller class. It is designed to make push
7
7
The core functionality of UI Manager is made up of only two simple classes: `UIManager` and `Screen`.
8
8
9
9
### UIManager
10
-
`UIManager` is responsible for instantiating and maintaining the screen stack. When you want to push or pop a screen to the stack, you interact with `UIManager`. `UIManager` has a few prerequisites that should be understood when using it:
10
+
`UIManager` is responsible for instantiating and maintaining the screen stack. When you want to push or pop a screen to the stack, you interact with `UIManager`.
11
+
12
+
`UIManager` has a few prerequisites that should be understood when using it:
11
13
12
14
> ### Prerequisites
13
-
>
14
-
> > 1.**IUpdateTransmitter**
15
-
> > UIManager is built on top of the IUpdateTransmitter and IUpdateObserver interfaces. UIManager is
16
-
> > an IUpdateObserver that needs to register with an IUpdateTransmitter in order to receive
17
-
> > 'OnUpdate' calls every frame.
18
15
> >
19
-
> > 2.**Screen Prefab Folder**
16
+
> > 1.**Screen Prefab Folder**
20
17
> > The UIManager looks for screen prefabs by name inside a specific folder that you specify in the
21
18
> > constructor. This folder must reside within a folder called 'Resources' in the Unity project.
> > *Example of a screen prefab directory structure.*
25
22
> >
26
23
> >
27
-
> > 3.**UI Root Canvas**
24
+
> > 2.**UI Root Canvas**
28
25
> > The UI Manager organizes all screens underneath a root Canvas object. You must provide the UI
29
26
> > Manager what Canvas object you want to use for this purpose.
30
27
> >
31
-
> > 4.***Optional* UI Camera**
28
+
> > 3.***Optional* UI Camera**
32
29
> > If you want to render your UI with a seperate Unity Camera you can pass it to the UIManager
33
30
> > inside the constructor. By default, Unity does not use a seperate Camera to render UI elements,
34
31
> > so this isn't necessary unless you need it.
@@ -96,13 +93,13 @@ The core functionality of UI Manager is made up of only two simple classes: `UIM
96
93
> to you as the developer to decide how to use in your project.
97
94
>
98
95
> ### Core Fields
99
-
> > ####keepCached
96
+
> > ####keepCached
100
97
> > `UIManager` gives you the option to disable a screen object instead of destroying it completely when
101
98
> > the screen is popped from the stack. This will keep the screen object cached in memory and when it is
102
99
> > pushed to the stack again will reuse the cached object instead of instancing a new one from the prefab.
103
100
>
104
101
> ### Core Methods
105
-
> > ####OnSetup
102
+
> > ####OnSetup
106
103
> > `OnSetup` is called after instantiating a screen prefab. It is only called once for the lifecycle of
107
104
> > the `Screen`.
108
105
> > #### OnPush
@@ -139,7 +136,7 @@ Included with the core `UIManager` classes is an example scene with example scri
139
136
Open the scene *UIExample* inside the *Example* folder.
140
137
141
138
Press play in the editor and play with the example to get a grasp of how it is organized.
142
-
When you're ready to look at the setup process and various screens in detail you should start by looking at the script `UI/Examples/Scripts/GameManager.cs`
139
+
When you're ready to look at the setup process and various screens in detail you should start by looking at the script `UIManager/Examples/Scripts/GameManager.cs`
143
140
144
141
This script is the entry point for the example and is where the `UIManager` is setup and the first screen is pushed onto the stack.
0 commit comments