Пример #1
0
 private void UpdateDeviceSpecifications(DeviceInfo deviceInfo, SystemInfoSimulation systemInfoSimulation)
 {
     m_OS.text         = "OS: " + (string.IsNullOrEmpty(deviceInfo.SystemInfo.operatingSystem) ? "N/A" : deviceInfo.SystemInfo.operatingSystem);
     m_CPU.text        = "CPU: " + (string.IsNullOrEmpty(deviceInfo.SystemInfo.processorType) ? "N/A" : deviceInfo.SystemInfo.processorType);
     m_GPU.text        = "GPU: " + systemInfoSimulation.GraphicsDependentData.graphicsDeviceType;
     m_Resolution.text = $"Resolution: {deviceInfo.Screens[0].width} x {deviceInfo.Screens[0].height}";
 }
Пример #2
0
        // Only gets called during initialization and switching device.
        public void Update(DeviceInfo deviceInfo, SystemInfoSimulation systemInfoSimulation, ScreenSimulation screenSimulation, SimulationPlayerSettings playerSettings)
        {
            if (deviceInfo == null)
            {
                return;
            }

            UpdateDeviceSpecifications(deviceInfo, systemInfoSimulation);
            m_SimulatorScreenSettings.Update(deviceInfo, screenSimulation, playerSettings);
        }
        public SimulatorControlPanel(VisualElement rootElement, DeviceInfo deviceInfo, SystemInfoSimulation systemInfoSimulation, ScreenSimulation screenSimulation,
                                     ApplicationSimulation applicationSimulation,
                                     SimulationPlayerSettings playerSettings, SimulatorSerializationStates states)
        {
            m_RootElement = rootElement;

            m_DeviceSpecifications         = new SimulatorDeviceSpecificationsUI(m_RootElement.Q <Foldout>("device-specifications"), deviceInfo, systemInfoSimulation);
            m_SimulatorScreenSettings      = new SimulatorScreenSettingsUI(m_RootElement.Q <Foldout>("screen-settings"), deviceInfo, screenSimulation, playerSettings);
            m_SimulatorApplicationSettings = new SimulatorApplicationSettingsUI(m_RootElement.Q <Foldout>("application-settings"), applicationSimulation, states);
            m_SimulatorExtensions          = new SimulatorExtensions();

            foreach (var extension in m_SimulatorExtensions.Extensions)
            {
                var foldout = new Foldout()
                {
                    text  = extension.extensionTitle,
                    value = false
                };
                foldout.AddToClassList("unity-device-simulator__control-panel_foldout");

                m_RootElement.Add(foldout);
                m_ExtensionFoldouts.Add(extension.GetType().ToString(), foldout);

                if (states != null && states.extensions.TryGetValue(extension.GetType().ToString(), out var serializedExtension))
                {
                    JsonUtility.FromJsonOverwrite(serializedExtension, extension);
                }

                extension.OnExtendDeviceSimulator(foldout);
            }
        }
Пример #4
0
        public SimulatorControlPanel(VisualElement rootElement, DeviceInfo deviceInfo, SystemInfoSimulation systemInfoSimulation, ScreenSimulation screenSimulation, SimulationPlayerSettings playerSettings)
        {
            m_RootElement = rootElement;

            InitDeviceSpecifications();
            UpdateDeviceSpecifications(deviceInfo, systemInfoSimulation);

            m_SimulatorScreenSettings = new SimulatorScreenSettingsUI(m_RootElement.Q <VisualElement>("screen-settings"), deviceInfo, screenSimulation, playerSettings);

            InitDeviceSimulatorExtensions();
        }
        public SimulatorDeviceSpecificationsUI(Foldout rootElement, DeviceInfo deviceInfo, SystemInfoSimulation systemInfoSimulation)
        {
            m_RootElement = rootElement;

            m_OS         = m_RootElement.Q <Label>("device_os");
            m_CPU        = m_RootElement.Q <Label>("device_cpu");
            m_GPU        = m_RootElement.Q <Label>("device_gpu");
            m_Resolution = m_RootElement.Q <Label>("device_resolution");

            Update(deviceInfo, systemInfoSimulation);
        }