Version: 2020.1

HelpBoxConstructor

切换到手册
public HelpBox ();
public HelpBox (string text, UIElements.HelpBoxMessageType messageType);

参数

text 消息文本。
messageType 消息类型。

描述

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)); } }