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. Progress Bar
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

Progress Bar

Author: admin 190 views

You can use progress bars as a health bar, mana bar, loading bar and so on. You can tweak the settings via inspector, but you can also change current percent or speed from your script.

Properties

Property Type Function

currentPercent

float

Returns/sets the current percent/value.

decimals

int

Divide the value by the specified decimal number.

isOn

bool

Returns/sets the progress bar state.

onValueChanged

UnityEvent

Process dynamic events on value/percent change.

Scripting

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

public class SampleClass : MonoBehaviour
{
    [SerializeField] private ProgressBar myBar; // Your pb variable

    void YourFunction()
    {
        myBar.currentPercent = 50f; // set current percent
        myBar.speed = 2; // set speed
        myBar.invert = true; // 100 to 0
        myBar.restart = true; // restart when it's 100
        myBar.isOn = false; // enable or disable counting
        myBar.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