public static void DirectURLConnect(string url)
 {
     ConsoleWindow.ShowConsoleWindow(true);
     AttachProfilerUI.ms_NotificationMessage = new GUIContent("Connecting to player...(this can take a while)");
     ProfilerDriver.DirectURLConnect(url);
     AttachProfilerUI.ms_NotificationMessage = null;
 }
Ejemplo n.º 2
0
 internal static void DirectURLConnect(string url)
 {
     // Profiler.DirectURLConnect is a blocking call, so a notification message is used to show the progress
     s_NotificationMessage = Content.ConnectingToPlayerMessage;
     ProfilerDriver.DirectURLConnect(url);
     s_NotificationMessage = null;
     SuccessfullyConnectedToPlayer(url);
 }
Ejemplo n.º 3
0
 public static void DirectURLConnect(string url)
 {
     // Profiler.DirectURLConnect is a blocking call, so a notification message and the console are used to show progress
     ConsoleWindow.ShowConsoleWindow(true);
     ms_NotificationMessage = EditorGUIUtility.TrTextContent("Connecting to player...(this can take a while)");
     ProfilerDriver.DirectURLConnect(url);
     ms_NotificationMessage = null;
 }
Ejemplo n.º 4
0
        private static void DrawConnectionGUI()
        {
            if (GUILayout.Button("Remote Devices…", EditorStyles.toolbarDropDown))
            {
                var menu        = new GenericMenu();
                var haveRemotes = InputSystem.devices.Any(x => x.remote);
                if (EditorConnection.instance.ConnectedPlayers.Count > 0)
                {
                    menu.AddItem(new GUIContent("Show remote devices"), haveRemotes, () =>
                    {
                        EnableRemoteDevices(!haveRemotes);
                    });
                }
                else
                {
                    menu.AddDisabledItem(new GUIContent("Show remote input devices"));
                }

                menu.AddSeparator("");

                var availableProfilers = ProfilerDriver.GetAvailableProfilers();
                foreach (var profiler in availableProfilers)
                {
                    var enabled      = ProfilerDriver.IsIdentifierConnectable(profiler);
                    var profilerName = ProfilerDriver.GetConnectionIdentifier(profiler);
                    var isConnected  = ProfilerDriver.connectedProfiler == profiler;
                    if (enabled)
                    {
                        menu.AddItem(new GUIContent(profilerName), isConnected, () => {
                            ProfilerDriver.connectedProfiler = profiler;
                            EnableRemoteDevices();
                        });
                    }
                    else
                    {
                        menu.AddDisabledItem(new GUIContent(profilerName));
                    }
                }

                foreach (var device in UnityEditor.Hardware.DevDeviceList.GetDevices())
                {
                    var supportsPlayerConnection = (device.features & UnityEditor.Hardware.DevDeviceFeatures.PlayerConnection) != 0;
                    if (!device.isConnected || !supportsPlayerConnection)
                    {
                        continue;
                    }

                    var url         = "device://" + device.id;
                    var isConnected = ProfilerDriver.connectedProfiler == 0xFEEE && ProfilerDriver.directConnectionUrl == url;
                    menu.AddItem(new GUIContent(device.name), isConnected, () => {
                        ProfilerDriver.DirectURLConnect(url);
                        EnableRemoteDevices();
                    });
                }

                menu.ShowAsContext();
            }
        }
Ejemplo n.º 5
0
 internal static void DirectURLConnect(string url)
 {
     // Profiler.DirectURLConnect is a blocking call, so a notification message and the console are used to show progress
     ConsoleWindow.ShowConsoleWindow(true);
     s_NotificationMessage = Content.ConnectingToPlayerMessage;
     ProfilerDriver.DirectURLConnect(url);
     s_NotificationMessage = null;
     SuccessfullyConnectedToPlayer(url);
 }