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. Modal Window
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

Modal Window

Author: admin 188 views

In order to change Modal Window content, you just need to change some values via Modal Window Manager (which is attached to the modal object).

At runtime, window content will be changing depending on its manager. If you want to change those values manually, you can enable ‘Use Custom Content’.

To call the window with a button, you can add a new event using the OnClick callback: Modal Window Object > Modal Window Manager > OpenWindow().

Properties

Property Type Function

icon

Sprite

Sets the content/header icon of the window.

titleText

string

Sets the content/header title of the window.

descriptionText

string

Sets the description of the window.

isOn

bool

Returns the modal window state.

useCustomContent

bool

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

Scripting

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

public class SampleClass : MonoBehaviour
{
    [SerializeField] private ModalWindowManager myModalWindow; // Your window variable

    void YourFunction()
    {
        myModalWindow.icon = spriteVariable; // Change icon
        myModalWindow.titleText = "New Title"; // Change title
        myModalWindow.descriptionText = "Description"; // Change desc
        myModalWindow.UpdateUI(); // Update UI
        myModalWindow.Open(); // Open window
        myModalWindow.Close(); // Close window
        myModalWindow.AnimateWindow(); // Close/Open window automatically
        myModalWindow.onConfirm.AddListener(TestFunction); // Add confirm events
        myModalWindow.onCancel.AddListener(TestFunction); // Add cancel events
    }

    void TestFunction()
    {
        Debug.Log("Test event");
    }
}				
			

How can we help?

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

© 2024 Michsky