public static void Show(Rect buttonScreenRect) { Rect rect = new Rect(buttonScreenRect.x, buttonScreenRect.yMax, 300, 50); AttachToPlayerPlayerIPWindow w = EditorWindow.GetWindowWithRect <AttachToPlayerPlayerIPWindow>(rect, true, Content.EnterPlayerIPWindowName); w.position = rect; w.m_Parent.window.m_DontSaveToLayout = true; }
void AddConnectionViaEnterIPWindow(ConnectionTreeViewWindow menuOptions, Rect buttonScreenRect, Func <bool> disabler = null) { menuOptions.AddItem(new ConnectionDropDownItem(Content.EnterIPText.text, -2, Content.DirectConnection, ConnectionDropDownItem.ConnectionMajorGroup.Direct, () => false, () => { AttachToPlayerPlayerIPWindow.Show(buttonScreenRect); GUIUtility.ExitGUI(); // clear the gui state to prevent hot control issues })); }
void AddLastConnectedIP(GenericMenu menuOptions, ref bool hasOpenConnection) { string lastIP = AttachToPlayerPlayerIPWindow.GetLastIPString(); if (string.IsNullOrEmpty(lastIP)) { return; } bool isConnected = ProfilerDriver.connectedProfiler == PLAYER_DIRECT_IP_CONNECT_GUID; hasOpenConnection |= isConnected; menuOptions.AddItem(new GUIContent(lastIP), isConnected, () => DirectIPConnect(lastIP)); }
void AddLastConnectedIP(ConnectionTreeViewWindow menuOptions, ref bool hasOpenConnection) { string lastIP = AttachToPlayerPlayerIPWindow.GetLastIPString(); if (string.IsNullOrEmpty(lastIP)) { return; } bool isConnected = ProfilerDriver.connectedProfiler == PLAYER_DIRECT_IP_CONNECT_GUID; hasOpenConnection |= isConnected; menuOptions.AddItem(new ConnectionDropDownItem(lastIP, PLAYER_DIRECT_IP_CONNECT_GUID, Content.DirectConnection, ConnectionDropDownItem.ConnectionMajorGroup.Direct, () => ProfilerDriver.connectedProfiler == PLAYER_DIRECT_IP_CONNECT_GUID, () => DirectIPConnect(lastIP))); }
void AddConnectionViaEnterIPWindow(GenericMenu menuOptions, Rect buttonScreenRect) { menuOptions.AddItem(Content.EnterIPText, false, () => AttachToPlayerPlayerIPWindow.Show(buttonScreenRect)); }