-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: generic dynamic context menu + reel gallery integration #3071
Conversation
# Conflicts: # Explorer/Assets/DCL/PluginSystem/DCL.Plugins.asmdef
# Conflicts: # Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/CameraReelGallery.asmdef # Explorer/Assets/DCL/PluginSystem/DCL.Plugins.asmdef # Explorer/Assets/DCL/PluginSystem/Global/Global Plugins Settings.asset # Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs
Windows and Mac build successfull in Unity Cloud! You can find a link to the downloadable artifact below. |
Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs
Outdated
Show resolved
Hide resolved
# Conflicts: # Explorer/Assets/DCL/ExplorePanel/Assets/ExplorePanelUI.prefab # Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Assets/CameraReel.prefab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work! Overall it is good enough for our current needs, but i dont 100% agree with the approach of scriptable objects and how the context menu is configured. First of all i dont see the real benefit of creating scriptable objects instead of having the pre-defined prefabs with a simply vertical layout that aligns all of its internal components. I see three downsides:
- We will not be able to see how the context menu looks until we run the app and finally see it in runtime. So if we need to do any modifications we will have to edit the SO and re rerun the app to check if changes are good enough, which is something that i do not find efficient.
- We cannot create context menues from code at runtime either, since we always need an SO with the settings behind it. So if we need to create something dynamic we will have limitations.
- We are not following the unity standard for UI components, which on all of them you can either configure it from the inspector in the scene and/or create a prefab from it.
Anyway i think that these concerns are not blocking issues at the moment, but we will see how it evolves during different use cases.
Explorer/Assets/DCL/InWorldCamera/CameraReelGallery/Components/OptionButtonController.cs
Outdated
Show resolved
Hide resolved
Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs
Outdated
Show resolved
Hide resolved
# Conflicts: # Explorer/Assets/DCL/PluginSystem/Global/Global Plugins Settings.asset
# Conflicts: # Explorer/Assets/AddressableAssetsData/AssetGroups/Essentials.asset # Explorer/Assets/DCL/ExplorePanel/Assets/ExplorePanelUI.prefab # Explorer/Assets/DCL/PluginSystem/Global/ExplorePanelPlugin.cs # Explorer/Assets/DCL/PluginSystem/Global/Global Plugins Settings.asset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good apart from the lack of typed bindings between views and configuration.
I left the corresponding comments, let's discuss and find a proper solution
Explorer/Assets/AddressableAssetsData/AssetGroups/Essentials.asset
Outdated
Show resolved
Hide resolved
...er/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs
Show resolved
Hide resolved
...er/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs
Outdated
Show resolved
Hide resolved
...er/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs
Show resolved
Hide resolved
Explorer/Assets/DCL/UI/GenericContextMenu/Controls/GenericContextMenuButtonWithTextView.cs
Outdated
Show resolved
Hide resolved
Explorer/Assets/DCL/UI/GenericContextMenu/Controls/Configs/ContextMenuControlSettings.cs
Outdated
Show resolved
Hide resolved
Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs
Outdated
Show resolved
Hide resolved
Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs
Outdated
Show resolved
Hide resolved
Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs
Outdated
Show resolved
Hide resolved
Explorer/Assets/DCL/UI/GenericContextMenu/GenericContextMenuController.cs
Outdated
Show resolved
Hide resolved
# Conflicts: # Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs
# Conflicts: # Explorer/Assets/DCL/PluginSystem/DCL.Plugins.asmdef # Explorer/Assets/Scripts/Global/Dynamic/DynamicWorldContainer.cs
… to specific control settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing my doubts 💪
...er/Assets/DCL/InWorldCamera/CameraReelGallery/Components/CameraReelOptionButtonController.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟢 Feat review verified on Windows and Mac. 3 dots button of a thumbnail and open the context menu.
Context menu itself works and that also every function works as expected. Smoke test performed covering:
- Login
- Backpack
- Teleport between scenes and worlds (The Inn, Metadynelabs, Doll House)
- Emoting
- Social interactions.
What does this PR change?
Introduce a generic context menu system that is completely configurable and it uses the MVC structure.
Its definition is done via code using the class
GenericContextMenu
. As of now, the available components are:ButtonContextMenuControlSettings
ToggleContextMenuControlSettings
SeparatorContextMenuControlSettings
(a divider composed by a simple grey line)Every control has its specifics parameters in order to adjust its appearance and specify the action to execute on interaction.
All the appearance configurations have already a default value so that they can be used out of the box.
The menu can be opened using the MVC Manager
mvcManager.ShowAsync(GenericContextMenuController.IssueCommand(new GenericContextMenuParameter())
by providingOptionally there are other parameters to provide:
Rect
which defines the usable space for the context menu (default is the full viewport) which is used to calculate the final position avoiding overlaps with the rect itselfAn integration in the camera reel gallery is included in this PR as a working example.
How to test the changes?
Our Code Review Standards
https://github.com/decentraland/unity-renderer/blob/master/docs/code-review-standards.md