{"id":16783105,"url":"https://github.com/bengreenier/unity-menustack","last_synced_at":"2025-04-10T22:19:19.711Z","repository":{"id":74695587,"uuid":"83377165","full_name":"bengreenier/Unity-MenuStack","owner":"bengreenier","description":"A way to track unity menu navigation that doesn't suck too much","archived":false,"fork":false,"pushed_at":"2018-03-24T16:20:09.000Z","size":385,"stargazers_count":12,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T19:21:38.446Z","etag":null,"topics":["menu","unity","unity3d"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bengreenier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-28T01:54:27.000Z","updated_at":"2023-08-29T10:45:21.000Z","dependencies_parsed_at":"2023-02-25T07:46:20.017Z","dependency_job_id":null,"html_url":"https://github.com/bengreenier/Unity-MenuStack","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengreenier%2FUnity-MenuStack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengreenier%2FUnity-MenuStack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengreenier%2FUnity-MenuStack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengreenier%2FUnity-MenuStack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bengreenier","download_url":"https://codeload.github.com/bengreenier/Unity-MenuStack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248306171,"owners_count":21081637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["menu","unity","unity3d"],"created_at":"2024-10-13T07:48:58.320Z","updated_at":"2025-04-10T22:19:19.703Z","avatar_url":"https://github.com/bengreenier.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unity-menustack\n\nA way to track unity menu navigation that doesn't suck too much.\n\n## What\n\nManaging the navigation of menu systems in unity is sucky. __It shouldn't be__.\n`unity-menustack` provides simple menu state tracking behaviours.\n\n## How\n\n\u003e See the generated docs ([raw](./docs) or [hosted](https://bengreenier.github.io/Unity-MenuStack)) for more info!\n\n### Prefixing\n\n\u003e By default, prefixing is enabled, but it costs us perf. To disable it, set `MenuRoot.DisableRuntimeTagging` to `true`\n\nPrefixing allows the building of menus given just `GameObject` names. At runtime, `Menu` or `OverlayMenu` components are added\nto facilitate the actual behaviours we expect.\n\nYou can tune which prefixes the system uses with `MenuRoot.MenuPrefix` and `MenuRoot.OverlayPrefix`.\n\nSince this is enabled by default, you don't need to worry about manually adding `Menu` or `MenuOverlay` components yourself.\n\n### Basic\n\n+ Include [Assets/Scripts](./Assets/Scripts) in your project\n+ Add a `MenuRoot` to some root level menu object\n+ Prefix the name of all child menus with `menu`\n+ Call `this.GetComponentInParent\u003cMenuRoot\u003e().OpenAsync(Menu)` or ``this.GetComponentInParent\u003cMenuRoot\u003e().CloseAsync()` from any submenu to navigate\n+ [Optional] Listen for `MenuRoot.Opened` and `MenuRoot.Closed` events to know when things change\n\n### Overlays\n\n\u003e Overlays are regular menus, except they don't hide the previous menu, they are displayed atop it\n\nTo use an overlay, simply prefix the name of a child menu with `overlay`.\n\n### Navigation\n\n\u003e Navigation provides wrappers around the `MenuRoot.OpenAsync(Menu)` and `MenuRoot.CloseAsync()` methods so you don't have to!\n\nSee [Assets/Examples/ComplexLayoutRigged.unity](./Assets/Examples/ComplexLayoutRigged.unity) for an example.\n\nThat said, the general idea is as follows:  \n\n+ Add some `INavigator` to a component that should trigger navigation\n+ Wire the trigger such that it calls `INavigator.Navigate()` (note: if the trigger is a button, it will be auto wired)\n+ Configure additional properties of the specific `INavigator` you chose\n\nHere's a button that's configured as a [BackMenuNavigator](https://bengreenier.github.io/Unity-MenuStack/class_menu_stack_1_1_navigation_1_1_back_menu_navigator.html):\n\n![screenshot backmenunav](./docs/img/backmenunav.png)\n\n### Animation\n\n\u003e Animation provides support for custom __pretty__ :dancer: transitions between menus!\n\nSee [Assets/Examples/AnimatedLayoutRigged.unity](./Assets/Examples/AnimatedLayoutRigged.unity) for an example.\n\nThat said, the general idea is as follows:  \n\n+ Add a `MenuAnimator` to some `Menu` that you want to animate\n+ This will add an `Animator` that you'll need to setup\n+ The Animator will need an AnimatorController, that you should define\n+ The AnimatorController should define two states, one for open, and one for close - by default these are expected to be named `Open` and `Close` (though you can change that)\n+ The AnimatorController should define two triggers, to enter each of these states - these must be named the same as the states\n+ The AnimatorController should define transitions between the two states, and each trigger should be a condition\n+ [Optional] you probably don't want your animation clips to loop, so select them, and turn off looping in the inspector\n\nThis will make your menus transition from `Close` to `Open` when they open, and `Open` to `Close` when they close.\n\n### Hierarchy viewer\n\n\u003e Hierarchy viewer is currently a beta feature, and should be treated as such!\n\nThe included `Window/MenuStack/Hierarchy` panel can be used to visualize the menustack and control visibility of different menus to make them easier to work with.\nWhen using this view, all history is tracked, and can be Reverted with the `Reset` button. Further, changes can be saved with the `Save` Button.\n\n![screenshot editorwindow](./docs/img/editorwindow.png)\n\n## Examples\n\nThere's a few examples under [Assets/Examples](./Assets/Examples). These should cover the major use cases\nand are fairly self explanatory. I'll do some deep dive explanations in the near future.\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbengreenier%2Funity-menustack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbengreenier%2Funity-menustack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbengreenier%2Funity-menustack/lists"}