EasyUINav is a program made with allowing for easier UI navigation. Gone are the days of spending time working on and configuring complex navigation setups manually. With EasyUINav, streamline your Unity UI navigation process effortlessly. Simply create a new navigation element by clicking the plus sign, then drag and drop a button to the "User Chosen" button slot, and assign the appropriate game objects to the enable and disable lists. Need to start fresh? Just click "reinitialize" to reset the lists and start anew. Save time and effort with EasyUINav, your go-to solution for simplified UI navigation in Unity.
Contains; Unity Package with all code and a dirt simple sample scene
-
Effortless UI Navigation: EasyUINav simplifies Unity UI navigation, eliminating the need for manual configuration.
-
Intuitive Setup: Create navigation elements effortlessly by clicking the plus sign and dragging buttons to the designated slots.
-
Customization Made Easy: Easily set UI actions with a simple drag and drop system.
-
Reset with Ease: Need to start over? Click "reinitialize" to reset lists and begin anew, saving time and streamlining your workflow.
-
Easily view all functions within a script and call void ones by simply clicking a boolean (Coming in v1.2, a singular error stops me currently)
-
To use the sample scene, please ensure TMP is installed! Upon clicking the scene with any new Unity version you should automatically see the TMP download window open!
- Download EasyUINav from the Unity Asset Store (Soon) or import it into your project from a package.
- Once imported, you'll find EasyUINav accessible from the Unity editor as a component!
- Open EasyUINav in the Unity editor.
- Click the plus sign (+) to create a new navigation element.
- Drag and drop a UI button from your scene hierarchy into the "User Chosen" button slot in the EasyUINav interface.
- Identify the game objects that should be enabled or disabled when navigating between UI elements.
- Drag these game objects into the corresponding "Enable" and "Disable" lists in the EasyUINav interface.
If you need to start over or make changes, simply click the "reinitialize" button to reset the lists and begin fresh.
Playtest your UI navigation in the Unity editor to ensure everything works as expected. Iterate on your navigation setup as needed, making adjustments for optimal user experience.
This script, Easy_UI_Nav
, is designed to simplify UI navigation in Unity. Let's break down its components:
-
Public Variables:
NavName
: A string variable to hold the name of the navigation.navs
: A list ofUINavigator
objects. EachUINavigator
represents a UI navigation setup.
-
UINavigator Class:
UserChosenButton
: A reference to the button that triggers the navigation.ItemsToEnable
: A list of game objects to enable when the button is clicked.ItemsToDisable
: A list of game objects to disable when the button is clicked.- The constructor initializes these properties.
-
Awake Method:
- Iterates through each
UINavigator
in thenavs
list. - Adds listeners to the
UserChosenButton
of eachUINavigator
. - When the button is clicked, it enables objects in
ItemsToEnable
and disables objects inItemsToDisable
.
- Iterates through each
-
EnableAll and DisableAll Methods:
- Enable or disable all game objects in the provided lists.
-
RunMethods Method:
- Not currently used in the provided script.
-
ObservedList Class:
- A generic list implementation with additional events for tracking changes.
- It provides functionality similar to
ObservableCollection
in C#. Becomes more important in 1.2.
-
Custom Editor (
Easy_UI_NavEditor
):- Extends the Unity
Editor
class to customize the appearance ofEasy_UI_Nav
in the Unity Inspector. - Provides a button to clear the lists of
ItemsToEnable
andItemsToDisable
for eachUINavigator
when clicked.
- Extends the Unity
-
KeyValue Class:
- A generic class to hold key-value pairs, used for serialization purposes.
Overall, this script facilitates UI navigation by allowing you to define button-click behaviors that enable/disable specific UI elements associated with each button. The ObservedList class adds functionality to track changes to lists, and the custom editor provides a convenient way to manage UI navigation setups within the Unity Editor.