/* ┌──────────────────────────────────────────────────────────────────┐ │ Author: Ivan Murzak (https://github.com/IvanMurzak) │ │ Repository: GitHub (https://github.com/IvanMurzak/Unity-MCP) │ │ Copyright (c) 2025 Ivan Murzak │ │ Licensed under the Apache License, Version 2.0. │ │ See the LICENSE file in the project root for more information. │ └──────────────────────────────────────────────────────────────────┘ */ #nullable enable using com.IvanMurzak.Unity.MCP.Editor.Utils; using UnityEditor; using UnityEditor.Toolbars; using UnityEngine; using UnityEngine.UIElements; namespace com.IvanMurzak.Unity.MCP.Editor.UI { [EditorToolbarElement(Id, typeof(SceneView))] public class OpenWindowButton : EditorToolbarButton { public const string Id = "ai-game-developer-toolbar/open-window"; public OpenWindowButton() { text = "Game Developer"; icon = EditorAssetLoader.LoadAssetAtPath(EditorAssetLoader.PackageLogoIcon); tooltip = "Open AI Game Developer window"; clicked += MainWindowEditor.ShowWindowVoid; RegisterCallback(OnDetachFromPanel); } private void OnDetachFromPanel(DetachFromPanelEvent evt) { clicked -= MainWindowEditor.ShowWindowVoid; } } }