概要
コード
using UnityEditor; using UnityEngine; using UnityEngine.UIElements; public class ExampleWindow : EditorWindow { [MenuItem("Window/ExampleWindow")] static void Init() { GetWindow<ExampleWindow>(); } void OnEnable() { var button1 = new Button(() => ShowWarning()); rootVisualElement.Add(button1); } void ShowWarning() { var content = new GUIContent(string.Empty, EditorGUIUtility.FindTexture("console.warnicon")); content.text = "Message"; ShowNotification(content, fadeoutWait: 5); } }