using UnityEngine; using UnityEditor; using UnityEngine.UIElements; using UnityEditor.UIElements; using System.Net; using System.Net.Sockets; [CustomEditor(typeof(StreamDeckServerManager))] public class StreamDeckServerManagerEditor : Editor { private const string UxmlPath = "Assets/Scripts/Streamdeck/Editor/UXML/StreamDeckServerManagerEditor.uxml"; private const string UssPath = "Assets/Scripts/Streamdeck/Editor/UXML/StreamDeckServerManagerEditor.uss"; private const string CommonUssPath = "Assets/Scripts/Streamingle/StreamingleControl/Editor/UXML/StreamingleCommon.uss"; private StreamDeckServerManager manager; private VisualElement playStatusContainer; private Label playStatusLabel; private Label lanIPLabel; private Label dashboardUrlLabel; private VisualElement dashboardPortField; public override VisualElement CreateInspectorGUI() { manager = (StreamDeckServerManager)target; var root = new VisualElement(); // Load stylesheets var commonUss = AssetDatabase.LoadAssetAtPath(CommonUssPath); if (commonUss != null) root.styleSheets.Add(commonUss); var uss = AssetDatabase.LoadAssetAtPath(UssPath); if (uss != null) root.styleSheets.Add(uss); // Load UXML var uxml = AssetDatabase.LoadAssetAtPath(UxmlPath); if (uxml != null) uxml.CloneTree(root); // Cache references playStatusContainer = root.Q("playStatusContainer"); playStatusLabel = root.Q