Created
March 22, 2024 11:06
-
-
Save baba-s/d0299161e42630718a4c1299e1f64ffa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEditor.Overlays; | |
using UnityEngine; | |
internal sealed class ExampleEditorWindow : | |
EditorWindow, | |
ISupportsOverlays | |
{ | |
[MenuItem( "Tools/ExampleEditorWindow" )] | |
private static void Open() | |
{ | |
GetWindow<ExampleEditorWindow>(); | |
} | |
private void OnGUI() | |
{ | |
GUILayout.Label( "ピカチュウ" ); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor.Overlays; | |
using UnityEngine.UIElements; | |
[Overlay | |
( | |
editorWindowType: typeof( ExampleEditorWindow ), | |
displayName: "ライチュウ", | |
defaultDisplay: true | |
)] | |
internal sealed class ExampleOverlay : Overlay | |
{ | |
public override VisualElement CreatePanelContent() | |
{ | |
var label = new Label(); | |
label.RegisterCallback<MouseEnterEvent>( _ => label.text = "マウスが入った" ); | |
label.RegisterCallback<MouseLeaveEvent>( _ => label.text = "マウスが出た" ); | |
return label; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment