Michsky – Docs Michsky – Docs
  • Home 
  • Documentation 
    • Hex UI 
    • Beam UI 
    • Reach UI 
    • Heat UI 
    • DreamOS 
    • Modern UI Pack 
    • Loading Screen Studio 
    • Dark UI 
    • Motion Titles Pack 
  • Contact 
Michsky – Docs Michsky – Docs
Michsky – Docs
  • Home 
  • Documentation 
    • Hex UI 
    • Beam UI 
    • Reach UI 
    • Heat UI 
    • DreamOS 
    • Modern UI Pack 
    • Loading Screen Studio 
    • Dark UI 
    • Motion Titles Pack 
  • Contact 

Modern UI Pack

  • Quick Start
  • How To (FAQs)
  • UI Elements
    • Button
    • Charts
    • Context Menu
    • Dropdown
    • Horizontal Selector
    • List View
    • Modal Window
    • Movable Window
    • Notification
    • Progress Bar
    • Slider
    • Switch
    • Tooltip
    • Window Manager
    • Other Elements
  • UI Manager
  • Others & Add-ons
  1. Home
  2. Modern UI Pack
  3. UI Elements
  4. Slider
Updated on August 3, 2022

Modern UI Pack

  • Quick Start
  • How To (FAQs)
  • UI Elements
    • Button
    • Charts
    • Context Menu
    • Dropdown
    • Horizontal Selector
    • List View
    • Modal Window
    • Movable Window
    • Notification
    • Progress Bar
    • Slider
    • Switch
    • Tooltip
    • Window Manager
    • Other Elements
  • UI Manager
  • Others & Add-ons

Slider

Author: admin 196 views

MUIP is using the native slider that comes with Unity UI, but we’ve added some new cool features into it. For scripting, you can use UnityEngine.UI.Slider.

Saving Data

You can save the slider value by checking this box. Note that every slider should has its own unique ‘Save Key’ value. Otherwise, there might be conflict(s) between sliders.

Properties

Property Type Function
useRoundValue
bool

Shows simplified value when enabled.

usePercent

bool

Adds percent tag when enabled.

mainSlider

UnityEngine.UI.Slider

The main slider source.

onValueChanged

UnityEvent

Process dynamic events on value change.

Scripting

				
					using Michsky.MUIP; // MUIP namespace
using UnityEngine;

public class SampleClass : MonoBehaviour
{
    [SerializeField] private SliderManager mySlider;

    void YourFunction()
    {
        mySlider.mainSlider.minValue = 0; // Change min value
        mySlider.mainSlider.maxValue = 0; // Change max value
        mySlider.mainSlider.value = 25f; // Change current slider value
        mySlider.usePercent = false; // Enabling/disabling percent
        mySlider.useRoundValue = false; // Show simplifed value
        mySlider.mainSlider.onValueChanged.AddListener(TestFunction); // Add new onValueChanged event
    }

    void TestFunction(float value)
    {
        Debug.Log("Current value: " + value.ToString());
    }
}				
			

Radial Slider

				
					using Michsky.MUIP; // MUIP namespace
using UnityEngine;

public class SampleClass : MonoBehaviour
{
    [SerializeField] private RadialSlider mySlider;

    void YourFunction()
    {
        mySlider.minValue = 0; // Change min value
        mySlider.maxValue = 0; // Change max value
        mySlider.currentValue = 25f; // Changing slider value
        mySlider.SliderValue = 25f; // Use this if you have problems with currentValue
        mySlider.UpdateUI(); // Updating UI
        mySlider.onValueChanged.AddListener(TestFunction); // Add new onValueChanged event
    }

    void TestFunction(float value)
    {
        Debug.Log("Current value: " + value.ToString());
    }
}				
			

How can we help?

A premium WordPress theme with an integrated Knowledge Base,
providing 24/7 community-based support.

© 2024 Michsky