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 

Hex UI

  • Quick Start
  • Animations
  • Controller & Input
    • Controller Manager
    • Controller Presets
    • Hotkey Event
    • UI Navigation
  • Handlers & Managers
    • Audio
    • Chapters
    • Credits
    • Effects
    • In-Game
  • Localization
    • Getting Started
    • Localization Settings
    • Localization Manager
    • Localized Object
  • UI Elements
    • Button
    • Dropdown
    • Modal Window
    • Notifications
    • Panel Manager
    • Progress Bar
    • Selectors
    • Slider
    • Switch
    • Timer
    • Widgets
    • Others
  • UI Manager
  • Others & Add-ons
  • FAQs
  1. Home
  2. Hex UI
  3. UI Elements
  4. Modal Window
Updated on May 19, 2024

Hex UI

  • Quick Start
  • Animations
  • Controller & Input
    • Controller Manager
    • Controller Presets
    • Hotkey Event
    • UI Navigation
  • Handlers & Managers
    • Audio
    • Chapters
    • Credits
    • Effects
    • In-Game
  • Localization
    • Getting Started
    • Localization Settings
    • Localization Manager
    • Localized Object
  • UI Elements
    • Button
    • Dropdown
    • Modal Window
    • Notifications
    • Panel Manager
    • Progress Bar
    • Selectors
    • Slider
    • Switch
    • Timer
    • Widgets
    • Others
  • UI Manager
  • Others & Add-ons
  • FAQs

Modal Window

Author: admin 78 views

Workflow

The window content will change at runtime depending on its manager. If you want to change these values manually, you can enable the ‘Use Custom Content’ option.

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

Localization

In order to use the localization system with modal windows, you can select the object and assign a valid localization key. Everything will be handled automatically as long as the localization system is active.

Scripting

				
					using UnityEngine;
using Michsky.UI.Hex; // Namespace

public class SampleClass : MonoBehaviour
{
    [SerializeField] private ModalWindowManager myWindow;
    [SerializeField] private Sprite icon;

    void Start()
    {
        // Set window icon and text
        myWindow.icon = icon;
        myWindow.titleText = "New Title";
        myWindow.descriptionText = "New Description";

        // Enable or disable buttons
        myWindow.showCancelButton = true;
        myWindow.showConfirmButton = true;

        // Apply the changes and update the UI
        myWindow.UpdateUI();

        // Add window events
        myWindow.onConfirm.AddListener(TestFunction);
        myWindow.onCancel.AddListener(TestFunction);
        myWindow.onOpen.AddListener(TestFunction);
        myWindow.onClose.AddListener(TestFunction);
        
        // Open or close the window
        myWindow.OpenWindow();
        myWindow.CloseWindow();
    }

    void TestFunction()
    {
        Debug.Log("Event test");
    }
}				
			

How can we help?

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

© 2024 Michsky