private void UpdateOverridePlayerSettingsStatus() { var buildTargetGroup = BuildTargetGroup.Unknown; var buildTarget = BuildTarget.NoTarget; if (m_DeviceInfo.IsAndroidDevice()) { buildTargetGroup = BuildTargetGroup.Android; buildTarget = BuildTarget.Android; } else if (m_DeviceInfo.IsiOSDevice()) { buildTargetGroup = BuildTargetGroup.iOS; buildTarget = BuildTarget.iOS; } bool isTargetSupported = BuildPipeline.IsBuildTargetSupported(buildTargetGroup, buildTarget); if (isTargetSupported) { m_OverrideDefaultPlayerSettings.SetEnabled(true); } else { m_OverrideDefaultPlayerSettings.SetEnabled(false); m_OverrideDefaultPlayerSettings.SetValueWithoutNotify(true); } }
public SystemInfoSimulation(DeviceInfo deviceInfo, SimulationPlayerSettings playerSettings, List <string> shimmedAssemblies) { m_ShimmedAssemblies = shimmedAssemblies; m_DeviceInfo = deviceInfo; if (m_DeviceInfo?.SystemInfo?.graphicsDependentData?.Length > 0) { if (deviceInfo.IsAndroidDevice()) { m_GraphicsDeviceType = ( from selected in playerSettings.androidGraphicsAPIs from device in m_DeviceInfo.SystemInfo.graphicsDependentData where selected == device.graphicsDeviceType select device).FirstOrDefault(); } else if (deviceInfo.IsiOSDevice()) { m_GraphicsDeviceType = ( from selected in playerSettings.iOSGraphicsAPIs from device in m_DeviceInfo.SystemInfo.graphicsDependentData where selected == device.graphicsDeviceType select device).FirstOrDefault(); } if (m_GraphicsDeviceType == null) { Debug.LogWarning("Could not pick GraphicsDeviceType, the game would fail to launch"); } } Enable(); }
public SystemInfoSimulation(DeviceInfo deviceInfo, SimulationPlayerSettings playerSettings, List <string> shimmedAssemblies) { const string dll = ".dll"; m_ShimmedAssemblies = shimmedAssemblies; m_ShimmedAssemblies.RemoveAll(string.IsNullOrEmpty); for (int i = 0; i < m_ShimmedAssemblies.Count; i++) { m_ShimmedAssemblies[i] = m_ShimmedAssemblies[i].ToLower(); if (!m_ShimmedAssemblies[i].EndsWith(dll)) { m_ShimmedAssemblies[i] += dll; } } m_DeviceInfo = deviceInfo; if (m_DeviceInfo?.SystemInfo?.GraphicsDependentData?.Length > 0) { if (deviceInfo.IsAndroidDevice()) { m_GraphicsDeviceType = ( from selected in playerSettings.androidGraphicsAPIs from device in m_DeviceInfo.SystemInfo.GraphicsDependentData where selected == device.graphicsDeviceType select device).FirstOrDefault(); } else if (deviceInfo.IsiOSDevice()) { m_GraphicsDeviceType = ( from selected in playerSettings.iOSGraphicsAPIs from device in m_DeviceInfo.SystemInfo.GraphicsDependentData where selected == device.graphicsDeviceType select device).FirstOrDefault(); } if (m_GraphicsDeviceType == null) { Debug.LogWarning("Could not pick GraphicsDeviceType, the game would fail to launch"); } } Enable(); }