-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEditorModal.cs
38 lines (30 loc) · 1000 Bytes
/
EditorModal.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//Author: https://github.com/seekeroftheball https://gist.github.com/seekeroftheball
//Version: 1.0
//Date: Feb 2023
using UnityEditor;
using UnityEngine;
namespace EditorModal
{
public class EditorPopupModal : EditorWindow
{
private struct WindowBounds
{
public const float WindowWidth = 242;
public const float WindowHeight = 72;
public static Vector2 WindowSize = new(WindowWidth, WindowHeight);
}
private EditorPopupModal()
{
minSize = WindowBounds.WindowSize;
maxSize = WindowBounds.WindowSize;
}
private void OnGUI() => DrawWindow();
private void OnInspectorUpdate() => Repaint();
private void DrawWindow()
{
GUILayout.Label("Here's some text in a pop-up window.\n\nPress Close to dismiss this message.", EditorStyles.wordWrappedLabel);
if (GUILayout.Button("Close"))
Close();
}
}
}