Version: 2021.1
LanguageEnglish
  • C#

HelpBox Constructor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public HelpBox();

Declaration

public HelpBox(string text, UIElements.HelpBoxMessageType messageType);

Parameters

text The message text.
messageType The type of message.

Description

Creates a new HelpBox.

using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine.UIElements;

public class HelpBoxExample : EditorWindow { [MenuItem("Example/Help Box")] static void ShowWindow() { HelpBoxExample window = (HelpBoxExample)EditorWindow.GetWindow(typeof(HelpBoxExample)); window.Show(); }

void OnEnable() { rootVisualElement.Add(new HelpBox("This is a help box", HelpBoxMessageType.Info)); } }