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

Modern UI Pack

  • Quick Start
  • 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
  • Examples
  1. Home
  2. Docs
  3. Modern UI Pack
  4. UI Elements
  5. Button
Updated on February 17, 2022

Modern UI Pack

  • Quick Start
  • 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
  • Examples

Button

Author: admin 60 views

There’s no usage difference, you can use MUIP buttons just like the default one. Icon and text variables can be changed via Button Manager. If you don’t want to change them by using Button Manager, you can enable ‘Use Custom Content’. For scripting, you can still continue to use UnityEngine.UI.Button class.

Properties

Property Type Function

buttonText

string

Defines the text shown on the button.

buttonIcon

Sprite

Defines the icon shown on the button.

clickEvent

UnityEvent

Process events on button click.

hoverEvent

UnityEvent

Process events on button hover.

clickSound

AudioClip

Audio clip that plays on button click.

hoverSound

AudioClip

Audio clip that plays on button hover.

useCustomContent

bool

Bypasses content properties (e.g. buttonText) when enabled.

Scripting

				
					using Michsky.UI.ModernUIPack; // namespace

public ButtonManager myButton; // There are several button mangers, such as ButtonManagerWithIcon

void YourFunction()
{
   // Updating button content
   myButton.buttonText = "My New Text";
   myButton.buttonIcon = SpriteVar;
   myButton.UpdateUI();
  
   // Enable or disable options
   myButton.useRipple = true;
   myButton.enableButtonSounds = true;
   myButton.useClickSound = true;
   myButton.useHoverSound = true;
   myButton.useCustomContent = false;
}				
			

How can we help?

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

Content

© 2022 Michsky