UI Elements

The Scenes folder contains a “test items” scene, which demonstrates how to use UI elements. This scene allows you to test the toggle, slider, and horizontal selector components.

Using the Slider

Warzone UI utilizes Unity's default Slider component. To learn more about how it works, refer to the Unity documentation: Unity Slider Documentation

Using the Toggle

Warzone UI utilizes Unity's default Toggle component. For more details, check out the documentation: Unity Toggle Documentation

Using the Horizontal Selector

An example script for Horizontal Selector can be found in the Scripts folder "DemoItems.cs". You can also check the demoitems scene for a working example.

Step-by-Step Guide

  1. Create a new script.

  2. Add the following code to define the Horizontal Selector component:

    public HorizontalSelector hSelector;
    public string value;
  3. Retrieve the Horizontal Selector value using the code below:

    value = hSelector.value;

This value can be used for any functionality as needed.

With this guide, you should be able to set up and use Warzone UI smoothly. If you need further assistance, feel free to join our Discord community. Happy coding!

Last updated