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: README.md
+70-64Lines changed: 70 additions & 64 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,48 +37,40 @@ Alternatively, open Packages/manifest.json and add the following to the dependen
37
37
38
38
## Basic Concepts
39
39
40
-
In NavStack, a single screen is divided into units called "Pages." The only requirement for being a Page is implementing the `IPage` interface. You can represent a Page with any object, such as a GameObject, VisualElement, or Scene. (An implementation for uGUI is provided by default.)
40
+
In NavStack, a screen is divided into units called "Pages." The only requirement for a Page is the implementation of the `IPage` interface, allowing any object such as GameObjects, VisualElements, or Scenes to be represented as a Page.
41
41
42
-
Page transitions and lifecycle management are handled by "Navigation." NavStack provides two types of Navigation: `INavigationStack`, which can stack Page transitions, and `INaviagtionSheet`, which only switches between active Pages without maintaining a history of transitions.
42
+
Screen transitions and lifecycle management are handled by "Navigation." NavStack provides two types of Navigation: `INavigationStack`, which can stack Page transitions, and `INaviagtionSheet`, which switches between active Pages without keeping a history of transitions.
43
43
44
44
## Page Lifecycle
45
45
46
-
The basic interface for a Page, `IPage`, has the following definition. Each event associated with a Page is called by Navigation, allowing you to customize the screen transition process by implementing these methods.
46
+
The `IPage` interface defines the basic events for a Page's lifecycle. Each event is called from the Navigation side, allowing customization of screen transition processes.
NavigationStack supports stacked screen transitions. When you push a Page onto the stack, it becomes the active Page, and the last Page pushed becomes the active Page. To push a Page, use`PushAsync()`, and to pop a Page, use`PopAsync()`.
73
+
NavigationStack supports stacked screen transitions. Pages pushed onto the stack are stacked, and the last pushed Page becomes the active Page. You can push a Page using`PushAsync()` and pop using`PopAsync()`.
In NavigationSheet, the Page lifecycle is handled as follows:
125
+
## NavigationContext
130
126
131
-
1.`OnInitialize` is called when adding a Page.
132
-
2. During transitions, `OnDisappear` is called for the previous Page and `OnAppear` for the new Page.
133
-
3.`OnCleanup` is called when removing a Page.
127
+
You can pass `NavigationContext` during Page transitions to pass data between Pages and specify transition options.
134
128
135
-
##NavigationOptions
129
+
### Passing Data
136
130
137
-
When performing Page transitions using Navigation, you can pass `NavigationOptions`. If omitted, the options specified in the Navigation's `DefaultOptions` are applied.
131
+
You can pass data to the destination Page through `NavigationContext`.
138
132
139
-
| Property | Description |
140
-
| - | - |
141
-
| Animated | Whether to play transition animations (default value is true) |
142
-
| AwaitOpearion | Behavior when a transition operation is called again while a Page transition is in progress (default value is NavigationAwaitOperation.Error) |
133
+
```cs
134
+
varpage=newExamplePage();
143
135
144
-
## Navigation Callbacks
136
+
varcontext=newNavigationContext()
137
+
{
138
+
Parameters= { { "id", "123456" } }
139
+
};
145
140
146
-
By implementing `INavigationCallbackReceiver`, you can add callbacks before and after each Page lifecycle event by adding objects to Navigation.
| Animated | Specifies whether to play transition animations (default is true). |
176
+
| AwaitOperation | Specifies the behavior when a transition operation is called again during Page transition (default is NavigationAwaitOperation.Error). |
168
177
169
-
NavStack provides components for handling Pages and Navigation with uGUI by default.
178
+
## Workflow for uGUI
170
179
171
180
When using NavStack with uGUI, add the `Navigation Stack` / `Navigation Sheet` component to any object placed under the Canvas.
@@ -211,7 +217,7 @@ public class SamplePage1 : Page
211
217
}
212
218
```
213
219
214
-
It's convenient to manage Prefabs of created Pages. Prefab-ized Pages can be added to Navigation using `PushNewObjectAsync()` or `AddNewObjectAsync()`, allowing for the generation/destruction of objects based on the Page lifecycle.
220
+
Prefab the created Page objects for convenience. By adding Prefabed Pages using `PushNewObjectAsync()` or `AddNewObjectAsync()`, you can manage object generation/destruction based on the Page lifecycle.
0 commit comments