From 2d696c2a5fc96a6e6ed241723c1eb75257508f8d Mon Sep 17 00:00:00 2001 From: Henry Jooste Date: Sun, 13 Jun 2021 13:10:49 +0200 Subject: [PATCH] Added documentation --- README.md | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9ee37f7..77d9706 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,83 @@ -# MenuBuilder -A simple menu system for Unity projects +# Menu Builder for Unity + +## License +You are free to do whatever you want with this library. You're allowed to use this for commercial projects, edit the source code and even redistribute the source code. No attribution is required (but appreciated) + +## Requirements +- Unity 2020.3.11f1 +- Unity Input System + +## Features +This tool allows you to create complex menus without writing a single line of code. It includes to following features +
    +
  1. Keyboard and controller support using the Unity Input System
  2. +
  3. Vertical and Horizontal style menus
  4. +
  5. Wrap-around when exceeding the start/end positions
  6. +
  7. Activated, deactivated, selected and canceled events that can be handled inside the editor
  8. +
+ +## Setting up the input +![Input System](https://i.imgur.com/cbsHqZ4.png) +This library includes demo input actions that should be perfect for any game. If you want to create your own, you can follow these steps: +
    +
  1. Right click in the project and select Create > Input Actions
  2. +
  3. Use InputActions as the name
  4. +
  5. Open the new Input Actions file
  6. +
  7. Create a new control scheme
  8. +
  9. Create a Menu Action Map
  10. +
  11. + Create the following actions: +
      +
    • Vertical (1D Axis)
    • +
    • Horizontal (1D Axis composite)
    • +
    • Select (Button binding)
    • +
    • Cancel (Button binding)
    • +
    +
  12. +
  13. Specify the key bindings for each action
  14. +
+ +Please refer to the official Unity documentation for more information: https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/QuickStartGuide.html + +## Handling input inside the scene +![Menu Input](https://i.imgur.com/lhuG8YP.png) +
    +
  1. Add a new empty game object to your scene
  2. +
  3. Add a Menu Input component to this new game object
  4. +
+ +This Menu Input component will read the input from the Unity Input System (using the InputActions file) and invoke the correct events when needed + +## Creating a menu +![Menu](https://i.imgur.com/2VzC3pt.png) +
    +
  1. Add a new empty game object to your scene
  2. +
  3. Add a Menu component to this new game object
  4. +
  5. + Set the properties of the menu +
      +
    • Active: A boolean value indicating if the menu can receive input events
    • +
    • Horizontal Menu: A boolean value indicating if the menu is horizontal (true) or vertical (false)
    • +
    • Wrap Around: Enable/disable the wrap-around feature when exceeding the start/end position of the menu
    • +
    • Menu Items: A list of all menu items managed by this menu
    • +
    +
  6. +
  7. Set up the canceled event (optional)
  8. +
+ +## Creating a menu item +![Menu Item](https://i.imgur.com/N03Q9cd.png) +
    +
  1. Add a new empty game object to your scene
  2. +
  3. Add a Menu Item component to this new game object
  4. +
  5. Set up the activated event (optional). This is invoked when the menu item is active
  6. +
  7. Set up the deactivated event (optional). This is invoked when the menu item is deactivated
  8. +
  9. Set up the selected event (optional). This is invoked when the menu item is selected
  10. +
  11. Design the menu item
  12. +
+ +Remember to add the menu item to the menu. Otherwise no events will be invoked + +## Demo +![Demo Scene](https://i.imgur.com/IAc8pEM.png) +This library includes a demo scene that shows you how to create both vertical and horizontal menus. It also includes different menus using different features available in the library. There's a Input directory that contains an InputActions file that should be perfect for your game \ No newline at end of file