UnityScreenNavigator icon indicating copy to clipboard operation
UnityScreenNavigator copied to clipboard

How to Find Page(Modal/Sheet)?

Open seoyeon01 opened this issue 1 year ago • 1 comments

Is there way to find the Page(Modal / Sheet) from container(or static method way like find container)? If it's not, is it by design reason?

For example, (I haven't tested it in detail, so there's probably something wrong with it.) image

duplicate pageName(Identifier) may have a problem. But in most cases, pageName seems to be used in a unique way.

or is there a better way? I'm wondering if there is room for this usage to cause problems.

seoyeon01 avatar Feb 27 '24 15:02 seoyeon01

In an ideal scenario, you should hold onto the pageId obtained during the OnLoad at the time of a push operation and use that.

https://github.com/Haruma-K/UnityScreenNavigator/blob/a8acf7c84b70732558fbcefd2305e0ddd2126e55/Assets/UnityScreenNavigator/Runtime/Core/Page/PageContainer.cs#L190C71-L190C77

There's also an overload for Pop that allows specifying an pageId

https://github.com/Haruma-K/UnityScreenNavigator/blob/a8acf7c84b70732558fbcefd2305e0ddd2126e55/Assets/UnityScreenNavigator/Runtime/Core/Page/PageContainer.cs#L250

Haruma-K avatar Feb 28 '24 00:02 Haruma-K