├── .gitattributes ├── .gitignore ├── Assets ├── HardwareInfo.meta ├── HardwareInfo │ ├── Editor.meta │ ├── Editor │ │ ├── HardwareInfoEditor.cs │ │ └── HardwareInfoEditor.cs.meta │ ├── Examples.meta │ ├── Examples │ │ ├── Comparison_Weights.PNG │ │ ├── Comparison_Weights.PNG.meta │ │ ├── Compatibility_Warnings.PNG │ │ ├── Compatibility_Warnings.PNG.meta │ │ ├── Inspector_ComplexData.PNG │ │ ├── Inspector_ComplexData.PNG.meta │ │ ├── Inspector_Overview.PNG │ │ ├── Inspector_Overview.PNG.meta │ │ ├── Inspector_SimpleData.PNG │ │ └── Inspector_SimpleData.PNG.meta │ ├── HardwareInfo.cs │ ├── HardwareInfo.cs.meta │ ├── HardwareInfo.prefab │ └── HardwareInfo.prefab.meta ├── Main.unity └── Main.unity.meta ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityAdsSettings.asset └── UnityConnectSettings.asset ├── README.md └── TODO.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | /[Bb]uilds/ 6 | /Assets/AssetStoreTools* 7 | 8 | # Autogenerated VS/MD solution and project files 9 | ExportedObj/ 10 | *.csproj 11 | *.unityproj 12 | *.sln 13 | *.suo 14 | *.tmp 15 | *.user 16 | *.userprefs 17 | *.pidb 18 | *.booproj 19 | *.svd 20 | 21 | 22 | # Unity3D generated meta files 23 | *.pidb.meta 24 | 25 | # Unity3D Generated File On Crash Reports 26 | sysinfo.txt 27 | 28 | # Builds 29 | *.apk 30 | *.unitypackage 31 | 32 | # ========================= 33 | # Operating System Files 34 | # ========================= 35 | 36 | # OSX 37 | # ========================= 38 | 39 | .DS_Store 40 | .AppleDouble 41 | .LSOverride 42 | 43 | # Thumbnails 44 | ._* 45 | 46 | # Files that might appear in the root of a volume 47 | .DocumentRevisions-V100 48 | .fseventsd 49 | .Spotlight-V100 50 | .TemporaryItems 51 | .Trashes 52 | .VolumeIcon.icns 53 | 54 | # Directories potentially created on remote AFP share 55 | .AppleDB 56 | .AppleDesktop 57 | Network Trash Folder 58 | Temporary Items 59 | .apdisk 60 | 61 | # Windows 62 | # ========================= 63 | 64 | # Windows image file caches 65 | Thumbs.db 66 | ehthumbs.db 67 | 68 | # Folder config file 69 | Desktop.ini 70 | 71 | # Recycle Bin used on file shares 72 | $RECYCLE.BIN/ 73 | 74 | # Windows Installer files 75 | *.cab 76 | *.msi 77 | *.msm 78 | *.msp 79 | 80 | # Windows shortcuts 81 | *.lnk 82 | -------------------------------------------------------------------------------- /Assets/HardwareInfo.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 328f8dd474bccb74fada386fb123ad61 3 | folderAsset: yes 4 | timeCreated: 1486715685 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/HardwareInfo/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ac099606f7034934a887a93598cf5965 3 | folderAsset: yes 4 | timeCreated: 1486715699 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/HardwareInfo/Editor/HardwareInfoEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.Collections; 4 | 5 | namespace Softdrink{ 6 | [CustomEditor(typeof(HardwareInfo))] 7 | public class HardwareInfoEditor : Editor { 8 | 9 | public override void OnInspectorGUI(){ 10 | HardwareInfo hwInfo = target as HardwareInfo; 11 | // Button for calculating score 12 | if(GUILayout.Button("Calculate Score")){ 13 | hwInfo.CalculateHardwareScore(); 14 | } 15 | EditorGUILayout.Space(); 16 | // Buttons for setting and clearing reference config 17 | if(GUILayout.Button("Set Reference Configuration")){ 18 | hwInfo.SetReference(); 19 | } 20 | if(GUILayout.Button("Clear Reference Configuration")){ 21 | hwInfo.ClearReference(); 22 | } 23 | EditorGUILayout.Space(); 24 | EditorGUILayout.Space(); 25 | 26 | // Display warnings if they exist 27 | string warnings = hwInfo.compatibilityWarnings; 28 | if(warnings.Length > 0){ 29 | string[] splitWarnings = warnings.Split('\n'); 30 | for(int i = 0; i < splitWarnings.Length-1; i++){ 31 | EditorGUILayout.Space(); 32 | EditorGUILayout.HelpBox(splitWarnings[i], MessageType.Warning); 33 | EditorGUILayout.Space(); 34 | } 35 | } 36 | 37 | DrawDefaultInspector(); 38 | 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Assets/HardwareInfo/Editor/HardwareInfoEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8d8b339ec6b1ff44e8f1729d82890551 3 | timeCreated: 1486715790 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/HardwareInfo/Examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80ffd9d8f54c32c42855579730dc8403 3 | folderAsset: yes 4 | timeCreated: 1486717731 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/HardwareInfo/Examples/Comparison_Weights.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/Assets/HardwareInfo/Examples/Comparison_Weights.PNG -------------------------------------------------------------------------------- /Assets/HardwareInfo/Examples/Comparison_Weights.PNG.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4f3622f40d7c144f8e607891e9eca07 3 | timeCreated: 1486717883 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 0 49 | spriteTessellationDetail: -1 50 | textureType: -1 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/HardwareInfo/Examples/Compatibility_Warnings.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/Assets/HardwareInfo/Examples/Compatibility_Warnings.PNG -------------------------------------------------------------------------------- /Assets/HardwareInfo/Examples/Compatibility_Warnings.PNG.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43553ff0df78b4241a0679370d6ac392 3 | timeCreated: 1486718720 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 0 49 | spriteTessellationDetail: -1 50 | textureType: -1 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/HardwareInfo/Examples/Inspector_ComplexData.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/Assets/HardwareInfo/Examples/Inspector_ComplexData.PNG -------------------------------------------------------------------------------- /Assets/HardwareInfo/Examples/Inspector_ComplexData.PNG.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 462e100f69cb9b34fa5179cac4c42db4 3 | timeCreated: 1486717834 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 0 49 | spriteTessellationDetail: -1 50 | textureType: -1 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/HardwareInfo/Examples/Inspector_Overview.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/Assets/HardwareInfo/Examples/Inspector_Overview.PNG -------------------------------------------------------------------------------- /Assets/HardwareInfo/Examples/Inspector_Overview.PNG.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a93e537be3a0714189a474266e3c287 3 | timeCreated: 1486717731 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 0 49 | spriteTessellationDetail: -1 50 | textureType: -1 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/HardwareInfo/Examples/Inspector_SimpleData.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/Assets/HardwareInfo/Examples/Inspector_SimpleData.PNG -------------------------------------------------------------------------------- /Assets/HardwareInfo/Examples/Inspector_SimpleData.PNG.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c50d023562100ec44a5748a790050d73 3 | timeCreated: 1486719710 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 0 49 | spriteTessellationDetail: -1 50 | textureType: -1 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/HardwareInfo/HardwareInfo.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | namespace Softdrink{ 4 | 5 | // HardwareInfo is a Singleton used to get information about the system hardware and software 6 | // This can then be used by other scripts to auto-set quality settings or for other convenience features 7 | 8 | // HardwareInfo will also compare a user's machine to a target "reference" machine (which can be defined 9 | // in the Inspector) and give it a comparative score based on that 10 | // Scores are out of 100.0; a score of 100 means the user machine is identical to the reference 11 | // Then, based on what graphics settings will run on the reference, graphics can be scaled on the user 12 | // NOTE: This comparison is a rough approximation only, and should not be taken as a truly accurate 13 | // performance benchmark of any sort 14 | public class HardwareInfo : MonoBehaviour { 15 | 16 | // Class for holding simple system info used for comparison 17 | [System.Serializable] 18 | public class SimpleHardwareInfo{ 19 | [HideInInspector] 20 | public bool initialized = false; 21 | 22 | // SIMPLE HARDWRE PARAMETERS 23 | [TooltipAttribute("Device type. Options are 'Desktop' (for Laptop, Tablet, or Desktop), 'Console', 'Handheld', 'Unknown'.")] 24 | public DeviceType deviceType = DeviceType.Unknown; 25 | [TooltipAttribute("GPU Rendering API information. See Rendering.GraphicsDeviceType documentation for details.")] 26 | public UnityEngine.Rendering.GraphicsDeviceType gpuDeviceType = UnityEngine.Rendering.GraphicsDeviceType.Null; 27 | 28 | [SpaceAttribute(10)] 29 | 30 | [TooltipAttribute("Graphics memory (VRAM), in MB. A value of -1 indicates an error.")] 31 | public int gpuMemory = -1; 32 | [TooltipAttribute("Graphics ability to multithread. Default is false.")] 33 | public bool gpuMultiThread = false; 34 | [TooltipAttribute("Graphics Shader Level. See SystemInfo.GraphicsShaderLevel documentation for details. A value of -1 indicates an error.")] 35 | public int gpuShaderLevel = -1; 36 | [TooltipAttribute("Maximum texture size supported by the GPU, in pixels. A value of -1 indicates an error.")] 37 | public int maxTextureSize = -1; 38 | 39 | [SpaceAttribute(10)] 40 | 41 | [TooltipAttribute("System memory (RAM), in MB. A value of -1 indicates an error.")] 42 | public int systemMemory = -1; 43 | [TooltipAttribute("Logical processor threads. A value of -1 indicates an error.")] 44 | public int processorCount = -1; 45 | [TooltipAttribute("Processor speed, in MHz. A value of -1 indicates an error.")] 46 | public int processorFrequency = -1; 47 | [TooltipAttribute("Does the system support GPU Compute Shaders? Defaults to false.")] 48 | 49 | [SpaceAttribute(10)] 50 | 51 | public bool supportsComputeShaders = false; 52 | [TooltipAttribute("Does the system support Image Effects and GPU-accelerated Post Processing? Defaults to false.")] 53 | public bool supportsImageEffects = false; 54 | [TooltipAttribute("Does the system support shadows? Defaults to false.")] 55 | public bool supportsShadows = false; 56 | 57 | [SpaceAttribute(10)] 58 | [Range(1.0f,3.5f)] 59 | [TooltipAttribute("SLI cannot be detected by Unity, so this number will multiply the GPU score to 'approximate' effect of SLI. Default is 1.0. \nSLI scaling is non-linear and varies by GPU, but a safe number for a dual-card system would be about 1.6.")] 60 | public float SLIScalar = 1.0f; 61 | 62 | public SimpleHardwareInfo(){ 63 | initialized = true; 64 | } 65 | 66 | // Set the hardwareInfo using the current system config 67 | public void SetFromCurrentConfig(){ 68 | deviceType = SystemInfo.deviceType; 69 | gpuDeviceType = SystemInfo.graphicsDeviceType; 70 | gpuMemory = SystemInfo.graphicsMemorySize; 71 | gpuMultiThread = SystemInfo.graphicsMultiThreaded; 72 | gpuShaderLevel = SystemInfo.graphicsShaderLevel; 73 | maxTextureSize = SystemInfo.maxTextureSize; 74 | processorCount = SystemInfo.processorCount; 75 | processorFrequency = SystemInfo.processorFrequency; 76 | supportsComputeShaders = SystemInfo.supportsComputeShaders; 77 | supportsImageEffects = SystemInfo.supportsImageEffects; 78 | supportsShadows = SystemInfo.supportsShadows; 79 | systemMemory = SystemInfo.systemMemorySize; 80 | } 81 | 82 | // Clear the current hardwareInfo 83 | public void Clear(){ 84 | deviceType = DeviceType.Unknown; 85 | gpuDeviceType = UnityEngine.Rendering.GraphicsDeviceType.Null; 86 | gpuMemory = -1; 87 | gpuMultiThread = false; 88 | gpuShaderLevel = -1; 89 | maxTextureSize = -1; 90 | processorCount = -1; 91 | processorFrequency = -1; 92 | supportsComputeShaders = false; 93 | supportsImageEffects = false; 94 | supportsShadows = false; 95 | systemMemory = -1; 96 | 97 | SLIScalar = 1.0f; 98 | 99 | initialized = false; 100 | } 101 | } 102 | 103 | // Class for holding complex system info - all properties including 'useless' stuff 104 | [System.Serializable] 105 | public class ComplexHardwareInfo{ 106 | [HideInInspector] 107 | public bool initialized = false; 108 | 109 | public string deviceModel = ""; 110 | public string deviceName = ""; 111 | public DeviceType deviceType = DeviceType.Unknown; 112 | public string deviceID = ""; 113 | public int gpuDeviceID = -1; 114 | public string gpuDeviceName = ""; 115 | public UnityEngine.Rendering.GraphicsDeviceType gpuDeviceType = UnityEngine.Rendering.GraphicsDeviceType.Null; 116 | public string gpuDeviceVendor = ""; 117 | public int gpuDeviceVendorID = -1; 118 | public string gpuDeviceVersion = ""; 119 | public int gpuMemory = -1; 120 | public bool gpuMultiThread = false; 121 | public int gpuShaderLevel = -1; 122 | public int maxTextureSize = -1; 123 | public NPOTSupport npotSupport = NPOTSupport.None; 124 | public string operatingSystem = ""; 125 | // public UnityEngine.OperatingSystemFamily operatingSystemFamily = UnityEngine.OperatingSystemFamily.Other; 126 | public int processorCount = -1; 127 | public int processorFrequency = -1; 128 | public string processorType = ""; 129 | public int supportedRenderTargetCount = -1; 130 | public bool supports2DArrayTextures = false; 131 | public bool supports3DTextures = false; 132 | public bool supportsAudio = false; 133 | public bool supportsComputeShaders = false; 134 | // public bool supportsCubemapArrayTextures = false; 135 | public bool supportsGyroscope = false; 136 | public bool supportsImageEffects = false; 137 | public bool supportsInstancing = false; 138 | public bool supportsLocationService = false; 139 | public bool supportsMotionVectors = false; 140 | public bool supportsRawShadowDepthSampling = false; 141 | public bool supportsRenderToCubemap = false; 142 | public bool supportsShadows = false; 143 | public bool supportsSparseTextures = false; 144 | public bool supportsVibration = false; 145 | // public bool usesReversedZBuffer = false; 146 | public int systemMemory = -1; 147 | 148 | public ComplexHardwareInfo(){ 149 | initialized = true; 150 | } 151 | 152 | // Set the hardwareInfo using the current system config 153 | public void SetFromCurrentConfig(){ 154 | deviceModel = SystemInfo.deviceModel; 155 | deviceName = SystemInfo.deviceName; 156 | deviceType = SystemInfo.deviceType; 157 | deviceID = SystemInfo.deviceUniqueIdentifier; 158 | gpuDeviceID = SystemInfo.graphicsDeviceID; 159 | gpuDeviceName = SystemInfo.graphicsDeviceName; 160 | gpuDeviceType = SystemInfo.graphicsDeviceType; 161 | gpuDeviceVendor = SystemInfo.graphicsDeviceVendor; 162 | gpuDeviceVendorID = SystemInfo.graphicsDeviceVendorID; 163 | gpuDeviceVersion = SystemInfo.graphicsDeviceVersion; 164 | gpuMemory = SystemInfo.graphicsMemorySize; 165 | gpuMultiThread = SystemInfo.graphicsMultiThreaded; 166 | gpuShaderLevel = SystemInfo.graphicsShaderLevel; 167 | maxTextureSize = SystemInfo.maxTextureSize; 168 | npotSupport = SystemInfo.npotSupport; 169 | operatingSystem = SystemInfo.operatingSystem; 170 | // operatingSystemFamily = SystemInfo.operatingSystemFamily; 171 | processorCount = SystemInfo.processorCount; 172 | processorFrequency = SystemInfo.processorFrequency; 173 | processorType = SystemInfo.processorType; 174 | supportedRenderTargetCount = SystemInfo.supportedRenderTargetCount; 175 | supports2DArrayTextures = SystemInfo.supports2DArrayTextures; 176 | supports3DTextures = SystemInfo.supports3DTextures; 177 | supportsAudio = SystemInfo.supportsAudio; 178 | supportsComputeShaders = SystemInfo.supportsComputeShaders; 179 | //supportsCubemapArrayTextures = SystemInfo.supportsCubemapArrayTextures; 180 | supportsGyroscope = SystemInfo.supportsGyroscope; 181 | supportsImageEffects = SystemInfo.supportsImageEffects; 182 | supportsInstancing = SystemInfo.supportsInstancing; 183 | supportsLocationService = SystemInfo.supportsLocationService; 184 | supportsMotionVectors = SystemInfo.supportsMotionVectors; 185 | supportsRawShadowDepthSampling = SystemInfo.supportsRawShadowDepthSampling; 186 | supportsRenderToCubemap = SystemInfo.supportsRenderToCubemap; 187 | supportsShadows = SystemInfo.supportsShadows; 188 | supportsSparseTextures = SystemInfo.supportsSparseTextures; 189 | supportsVibration = SystemInfo.supportsVibration; 190 | //usesReversedZBuffer = SystemInfo.usesReversedZBuffer; 191 | systemMemory = SystemInfo.systemMemorySize; 192 | } 193 | } 194 | 195 | // Class for storing the weighting information for different parameters 196 | [System.Serializable] 197 | public class HardwareComparisonWeights{ 198 | [HideInInspector] 199 | public bool initialized = false; 200 | 201 | [HeaderAttribute("Device Type Weights")] 202 | // Weights for device type 203 | [Range(0.0f, 1.0f)] 204 | [TooltipAttribute("Weight for the Desktop device type (which includes Laptops and some Tablets). Points are set to 100 * this value.")] 205 | public float desktopWeight = 1.0f; 206 | [Range(0.0f, 1.0f)] 207 | [TooltipAttribute("Weight for the Console device type. Points are set to 100 * this value.")] 208 | public float consoleWeight = 1.0f; 209 | [Range(0.0f, 1.0f)] 210 | [TooltipAttribute("Weight for the Console device type. Points are set to 100 * this value.")] 211 | public float handheldWeight = 0.7f; 212 | 213 | //[SpaceAttribute(10)] 214 | //[HeaderAttribute("Main Property Weights")] 215 | // Weights for main categories - CPU, GPU 216 | //[Range(0.0f, 1.0f)] 217 | //public float CPUWeight = 0.5f; 218 | //[Range(0.0f, 1.0f)] 219 | //public float GPUWeight = 0.5f; 220 | // Weight for RAM 221 | //[Range(0.0f, 1.0f)] 222 | //public float RAMWeight = 0.25f; 223 | [SpaceAttribute(10)] 224 | [Range(1,8)] 225 | [TooltipAttribute("If the User's Processor has more than this many logical cores, the additional ones do not factor into the score. \nThis is helpful since Unity primarily stresses only one thread.")] 226 | public int ignoreCoresAbove = 2; 227 | 228 | [SpaceAttribute(10)] 229 | [HeaderAttribute("Penalties")] 230 | [Range(0.0f, 1.0f)] 231 | [TooltipAttribute("Penalty for failing to support GPU multithreading. GPU score -= (GPU score * this value).")] 232 | public float gpuMultithreadPenalty = 0.5f; 233 | // Weight for Compute Shaders 234 | [Range(0.0f, 1.0f)] 235 | [TooltipAttribute("Penalty for failing to support Compute Shaders. Score -= (score * this value).")] 236 | public float computePenalty = 0.5f; 237 | // Weight for Image Effects 238 | [Range(0.0f, 1.0f)] 239 | [TooltipAttribute("Penalty for failing to support Image Effects. Score -= (score * this value).")] 240 | public float imageEffectPenalty = 0.25f; 241 | // Weight for Shadow support 242 | [Range(0.0f, 1.0f)] 243 | [TooltipAttribute("Penalty for failing to support Shadows. Score -= (score * this value).")] 244 | public float shadowPenalty = 0.9f; 245 | 246 | public HardwareComparisonWeights(){ 247 | initialized = true; 248 | } 249 | 250 | } 251 | 252 | // Singleton instance 253 | public static HardwareInfo Instance = null; 254 | 255 | [HeaderAttribute("Final User Score")] 256 | [ContextMenuItem ("Calculate Score", "CalculateHardwareScore")] 257 | [TooltipAttribute("The final calculated User Hardware Score, calibrated to a scale of 100. \nA score of 100 means that the User hardware matches the Reference hardware exactly. \nLess than 100 means the User is a lesser system, and more than 100 means the User is a greater system.")] 258 | public float userHardwareScore = 0.0f; 259 | 260 | [HeaderAttribute("Breakdown")] 261 | 262 | [ContextMenuItem ("Calculate Score", "CalculateHardwareScore")] 263 | [TooltipAttribute("The GPU score for the User System, calibrated to a scale of 100 where 100 = Reference.")] 264 | public float userGPUScore = 0.0f; 265 | [ContextMenuItem ("Calculate Score", "CalculateHardwareScore")] 266 | [TooltipAttribute("The CPU score for the User System, calibrated to a scale of 100 where 100 = Reference.")] 267 | public float userCPUScore = 0.0f; 268 | 269 | [HeaderAttribute("Warnings")] 270 | 271 | [HideInInspector] 272 | //[TextArea(6,6)] 273 | //[ContextMenuItem ("Calculate Score", "CalculateHardwareScore")] 274 | public string compatibilityWarnings = ""; 275 | 276 | [SpaceAttribute(20)] 277 | 278 | [SerializeField] 279 | private HardwareComparisonWeights comparisonWeights; 280 | 281 | // Toggle for SIMPLE vs COMPLEX data 282 | [SerializeField] 283 | [SpaceAttribute(10)] 284 | [ContextMenuItem ("Set Reference", "SetReference")] 285 | [ContextMenuItem ("Clear Reference", "ClearReference")] 286 | private bool useComplexHardwareData = false; 287 | // SIMPLE DATA is defined as what is necessary for the comparison operation: 288 | // Device Type 289 | // GPU memory 290 | // GPU multithreading 291 | // GPU shader level 292 | // GPU max texture size 293 | // CPU frequency 294 | // System Memory 295 | // Support for Compute Shaders 296 | // Support for Image Effects 297 | // Support for Shadows 298 | 299 | // COMPLEX DATA is defined as all other data 300 | 301 | // Add a ContextMenu item to set the reference configuration 302 | [SpaceAttribute(10)] 303 | [ContextMenuItem ("Set Reference", "SetReference")] 304 | [ContextMenuItem ("Clear Reference", "ClearReference")] 305 | public SimpleHardwareInfo referenceConfiguration; 306 | [ContextMenuItem ("Set Reference", "SetReference")] 307 | [ContextMenuItem ("Clear Reference", "ClearReference")] 308 | public SimpleHardwareInfo userConfiguration; 309 | 310 | // [HideInInspector] 311 | [ContextMenuItem ("Set Reference", "SetReference")] 312 | [ContextMenuItem ("Clear Reference", "ClearReference")] 313 | public ComplexHardwareInfo complexUserConfiguration; 314 | 315 | void Awake (){ 316 | // If the Instance doesn't already exist 317 | if(Instance == null){ 318 | // If the instance doesn't already exist, set it to this 319 | Instance = this; 320 | }else if(Instance != this){ 321 | // If an instance already exists that isn't this, destroy this instance and log what happened 322 | Destroy(gameObject); 323 | Debug.LogError("ERROR! The HardwareInfo script encountered another instance of HardwareInfo; it destroyed itself rather than overwrite the existing instance.", this); 324 | } 325 | 326 | // Create the Weights if they do not already exist 327 | if(comparisonWeights == null || comparisonWeights.initialized == false) comparisonWeights = new HardwareComparisonWeights(); 328 | 329 | // Create the Reference info from the current config if it does not already exist 330 | if(referenceConfiguration == null || referenceConfiguration.initialized == false) referenceConfiguration = new SimpleHardwareInfo(); 331 | // Create the User info from the current config 332 | userConfiguration = new SimpleHardwareInfo(); 333 | userConfiguration.SetFromCurrentConfig(); 334 | 335 | // If we are using complex info, create it from the current info 336 | if(useComplexHardwareData){ 337 | complexUserConfiguration = new ComplexHardwareInfo(); 338 | complexUserConfiguration.SetFromCurrentConfig(); 339 | }else complexUserConfiguration = null; // Otherwise set it to null for GC to deal with it later 340 | 341 | // Calculate user score 342 | CalculateHardwareScore(); 343 | 344 | } 345 | 346 | // Calculate user hardware score 347 | public void CalculateHardwareScore(){ 348 | 349 | // Clear compatibility warnings 350 | compatibilityWarnings = ""; 351 | 352 | float basePoints = 100.0f; 353 | if(userConfiguration.deviceType == referenceConfiguration.deviceType) basePoints *= 1.0f; 354 | else{ 355 | if(userConfiguration.deviceType == DeviceType.Desktop) basePoints *= comparisonWeights.desktopWeight; 356 | if(userConfiguration.deviceType == DeviceType.Console) basePoints *= comparisonWeights.consoleWeight; 357 | if(userConfiguration.deviceType == DeviceType.Handheld) basePoints *= comparisonWeights.handheldWeight; 358 | } 359 | 360 | // Check that they use the same graphics APIs and flag a warning if not 361 | if(userConfiguration.gpuDeviceType != referenceConfiguration.gpuDeviceType) compatibilityWarnings += "WARNING: The reference configration and user configuration are using different graphics APIs. This may cause incompatibility or rendering issues.\n"; 362 | 363 | float GPUScore = 1.0f; 364 | GPUScore *= (float)(userConfiguration.gpuMemory)/(float)(referenceConfiguration.gpuMemory); 365 | GPUScore *= (float)(userConfiguration.gpuShaderLevel)/(float)(referenceConfiguration.gpuShaderLevel); 366 | // If there is a difference of more than 5 in reference and user GPU shader levels, create a warning 367 | if((referenceConfiguration.gpuShaderLevel - userConfiguration.gpuShaderLevel) > 5){ 368 | compatibilityWarnings += "WARNING: The reference configuration and user configuration support different Shader Models. This may cause incompatibility or rendering issues.\n"; 369 | } 370 | GPUScore *= (float)(userConfiguration.maxTextureSize)/(float)(referenceConfiguration.maxTextureSize); 371 | if(userConfiguration.gpuMultiThread == false && referenceConfiguration.gpuMultiThread == true){ 372 | GPUScore -= (GPUScore * comparisonWeights.gpuMultithreadPenalty); 373 | compatibilityWarnings += "WARNING: The reference configuration supports GPU multithreading, but the user configuration does not!\n"; 374 | } 375 | GPUScore *= userConfiguration.SLIScalar/referenceConfiguration.SLIScalar; 376 | //GPUScore *= comparisonWeights.GPUWeight; 377 | userGPUScore = GPUScore * 100.0f; 378 | 379 | float CPUScore = 1.0f; 380 | if(userConfiguration.processorCount > comparisonWeights.ignoreCoresAbove) CPUScore *= 1.0f; 381 | else CPUScore *= (float)userConfiguration.processorCount/(float)referenceConfiguration.processorCount; 382 | CPUScore *= (float)userConfiguration.processorFrequency/(float)referenceConfiguration.processorFrequency; 383 | //CPUScore *= comparisonWeights.CPUWeight; 384 | userCPUScore = CPUScore * 100.0f; 385 | 386 | float RAMScore = 1.0f; 387 | RAMScore *= (float)userConfiguration.systemMemory/(float)referenceConfiguration.systemMemory; 388 | //RAMScore *= comparisonWeights.RAMWeight; 389 | 390 | float avgScore = CPUScore + GPUScore + RAMScore; 391 | avgScore = avgScore / 3.0f; 392 | 393 | //float penalties = 0.0f; 394 | Vector3 penaltyVect = new Vector3(comparisonWeights.shadowPenalty, comparisonWeights.computePenalty, comparisonWeights.imageEffectPenalty); 395 | //float penaltySize = penaltyVect.x + penaltyVect.y + penaltyVect.z; 396 | //penaltyVect *= 1.0f/penaltySize; 397 | // penaltyVect.Normalize(); 398 | if(userConfiguration.supportsShadows == referenceConfiguration.supportsShadows) avgScore *= 1.0f; 399 | else{ 400 | if(userConfiguration.supportsShadows == false && referenceConfiguration.supportsShadows == true){ 401 | avgScore *= (1.0f - penaltyVect.x); 402 | compatibilityWarnings += "WARNING: The reference configuration supports shadows, but the user configuration does not!\n"; 403 | } 404 | } 405 | if(userConfiguration.supportsComputeShaders == referenceConfiguration.supportsComputeShaders) avgScore *= 1.0f; 406 | else{ 407 | if(userConfiguration.supportsComputeShaders == false && referenceConfiguration.supportsComputeShaders == true){ 408 | avgScore *= (1.0f - penaltyVect.y); 409 | compatibilityWarnings += "WARNING: The reference configuration supports Compute Shaders, but the user configuration does not!\n"; 410 | } 411 | } 412 | if(userConfiguration.supportsImageEffects == referenceConfiguration.supportsImageEffects) avgScore *= 1.0f; 413 | else{ 414 | if(userConfiguration.supportsImageEffects == false && referenceConfiguration.supportsImageEffects == true){ 415 | avgScore *= (1.0f - penaltyVect.z); 416 | compatibilityWarnings += "WARNING: The reference configuration supports Image Effects, but the user configuration does not!\n"; 417 | } 418 | } 419 | 420 | //avgScore *= (1.0f - penalties); 421 | 422 | 423 | userHardwareScore = avgScore*basePoints; 424 | //userHardwareScore = penalties; 425 | } 426 | 427 | // Get Compatibility Warnings, or check if they exist at all 428 | public static bool CompatibilityCheck(){ 429 | if(Instance.compatibilityWarnings.Length > 0) return false; 430 | 431 | return true; 432 | } 433 | public static string GetWarnings(){ 434 | return Instance.compatibilityWarnings; 435 | } 436 | 437 | // Get User, Reference, and Complex User Data 438 | public static SimpleHardwareInfo GetUserHardwareInfo(){ 439 | return Instance.userConfiguration; 440 | } 441 | 442 | public static SimpleHardwareInfo GetReferenceHardwareInfo(){ 443 | return Instance.referenceConfiguration; 444 | } 445 | 446 | public static ComplexHardwareInfo GetComplexUserHardwareInfo(){ 447 | if(Instance.complexUserConfiguration != null) return Instance.complexUserConfiguration; 448 | 449 | return null; 450 | } 451 | 452 | // Set and clear reference values 453 | public void SetReference(){ 454 | referenceConfiguration.SetFromCurrentConfig(); 455 | } 456 | 457 | public void ClearReference(){ 458 | referenceConfiguration.Clear(); 459 | referenceConfiguration = null; 460 | } 461 | 462 | } 463 | 464 | } 465 | -------------------------------------------------------------------------------- /Assets/HardwareInfo/HardwareInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d193f3f5e4c8974c961fc971e44c37b 3 | timeCreated: 1486618883 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/HardwareInfo/HardwareInfo.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/Assets/HardwareInfo/HardwareInfo.prefab -------------------------------------------------------------------------------- /Assets/HardwareInfo/HardwareInfo.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1db868d4fd1cc4b41a72de02e352527b 3 | timeCreated: 1486628296 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Main.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/Assets/Main.unity -------------------------------------------------------------------------------- /Assets/Main.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03e28a2c01ce0184e923590601fecc85 3 | timeCreated: 1486618898 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/ProjectSettings/ClusterInputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.4.0f3 2 | m_StandardAssetsVersion: 0 3 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /ProjectSettings/UnityAdsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/ProjectSettings/UnityAdsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Softdrink117/unity-system-info-detection/3cbffc7b689b4b3e1ea54830efe11dda8a659bb1/ProjectSettings/UnityConnectSettings.asset -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # unity-system-info-detection 2 | Automatic hardware detection and evaluation in Unity 3 | 4 | ![HardwareInfo Overview](/Assets/HardwareInfo/Examples/Inspector_Overview.PNG) 5 | 6 | A set of scripts to evaluate the user's hardware configuration relative to a "reference" configuration. Thought not an exhaustive test by any means, and not necessarily accurate, it can be used as a baseline to approximate what Quality Settings to use for a first-time user of a Unity game. 7 | 8 | ###Details 9 | 10 | The HardwareInfo script does three basic things: 11 | * **It gets system information** - GPU VRAM, shader model, API, shadow/compute/image effect support, cpu cores and frequency, etc. - from the computer it is running on. 12 | * **It compares this system information to a saved 'reference' configuration,** and gives the current machine a System Score scaled to 100. A score of 100 means that the new machine is identical to the reference; a score of less than 100 means that the new machine is less powerful than the reference; a score of more than 100 means that the new machine is more powerful than the reference. 13 | * **It produces warnings when the current machine and the reference machine have serious differences** that might cause errors, such as significantly different shader models, lack of support for core features like shadows and image effects, and different graphics APIs 14 | 15 | It is capable of obtaining much more sophisticated system information as well (manufacturer of motherboard and GPU; system name, system unique ID, detailed support for Unity engine features, etc.) 16 | 17 | ###Usage 18 | 19 | The basic *(as-yet-untested)* usage idea is as follows: 20 | 21 | 1. Set up the game on a known 'Reference' machine, and save it as the Reference Configuration. 22 | 2. Then set up the game on a different (ideally lesser) machine, and observe the User Score given by the HardwareInfo script. 23 | * Record information about the framerate on both machines, to compare. 24 | 3. Ideally, repeat step 2 on multiple machines to get more points of reference for System Score and performance. 25 | 26 | Assuming a deterministic relationship between game performance and System Score *(which may or may not be the case! Testing is needed!)*, calculating a system score on the first run of a game should allow the Unity game to automatically determine it's optimal settings. 27 | 28 | --- 29 | 30 | ###TODO: 31 | * Make custom editor 32 | * Actually test this 33 | 34 | --- 35 | 36 | ###Features 37 | 38 | ####Automatic Compatibility Warnings 39 | ![Compatibility Warnings](/Assets/HardwareInfo/Examples/Compatibility_Warnings.PNG) 40 | 41 | The *HardwareInfo* script can determine if there are obvious compatibility issues between the Reference and User machines, and exposes them as visible Warning messages in the Inspector. Currently, it checks for Shadows, Graphics API, GPU Multithreading, Shader Model, Compute Shader, and Image Effect support. The Compatibility Warnings are also accessible by script (*through an admittedly extremely primitive set of methods right now, but these would be easily expandable to suit a project's needs*). 42 | 43 | ####Adjustable Score Calculation 44 | ![Comparison Weights](/Assets/HardwareInfo/Examples/Comparison_Weights.PNG) 45 | 46 | The equation used for determining a Score can be modified to suit a specific project. Some weights are exposed in the Inspector that allow for fine-tuning of the output; the score calculation is also very self-explanatory and (*will be*) documented in code. 47 | 48 | ####Simple and Complex Data Classes 49 | ![Simple Data](/Assets/HardwareInfo/Examples/Inspector_SimpleData.PNG) 50 | 51 | The *HardwareInfo* script automatically obtains some Simple Hardware Info from the current machine on Awake(), and compares it to stored Reference Data. The Simple Hardware Info class is used to store the information that is necessary for the comparison. It also contains an 'SLI Scalar' property (only used for the Reference Machine) that accounts for the fact that Unity cannot detect an SLI configuration (*at least, as far as I can tell*), and also accounts for the nonlinear scaling of SLI performance. 52 | 53 | ![Complex Data](/Assets/HardwareInfo/Examples/Inspector_ComplexData.PNG) 54 | 55 | In addition to the Simple Hardware Info class used to calculate the System Score, the *HardwareInfo* script can also be used to get a copy of the complete system data that is currently exposed to Unity's SystemInfo class (*Current as of Unity 5.4.0f3 for this build version, which was created for a project in a slightly outdated version of Unity. I plan to release a 5.5 and 5.6 version in the near future.*). This could be useful for any number of reasons. The Complex Data can be toggled on and off, to save on memory usage and performance. 56 | -------------------------------------------------------------------------------- /TODO.txt: -------------------------------------------------------------------------------- 1 | -Create a function (editor script? or just another Component?) that lets users run a test on the current machine and save the hardware score and some performance benchmark (FPS?) 2 | -Create some utitlity that stores various scores 3 | -Create some utility that compares all scores, creates line of best fit, and places the current machine score relative to the line of best fit. This allows for performance-metric based scaling of effects and such, using a database of existing scores. --------------------------------------------------------------------------------