using System; using UnityEngine; namespace DebuggingEssentials { [Serializable] public struct ComponentIcons { public Texture gameObjectIcon; public Texture transformIcon; public Texture cameraIcon; public Texture csScriptIcon; public Texture audioListenerIcon; public Texture audioSourceIcon; public Texture rigidbodyIcon; public Texture boxColliderIcon; public Texture capsuleColliderIcon; public Texture meshColliderIcon; public Texture sphereColliderIcon; public Texture terrainColliderIcon; public Texture wheelColliderIcon; public Texture meshFilterIcon; public Texture meshRendererIcon; public Texture pointLightIcon; public Texture directionalLightIcon; public Texture spotLightIcon; public Texture areaLightIcon; public Texture fontIcon; public Texture lightingDataAssetIcon; public Texture lightProbesIcon; public Texture materialIcon; public Texture meshIcon; public Texture renderTextureIcon; public Texture texture2DIcon; public Texture textureImporterIcon; public Texture scriptableObjectIcon; public Texture shaderIcon; public Texture shaderVariantCollectionIcon; public Texture computeShaderIcon; public Texture editorSettingsIcon; public Texture cubemapIcon; public Texture animationIcon; public Texture flareLayerIcon; public Texture guiLayerIcon; public Texture lightProbeProxyVolumeIcon; public Texture lightProbeGroupIcon; public Texture GetIcon(object obj) { if (obj is GameObject) { return gameObjectIcon; } if (obj is Transform) { return transformIcon; } if (obj is Camera) { return cameraIcon; } if (obj is AudioListener) { return audioListenerIcon; } if (obj is AudioSource) { return audioSourceIcon; } if (obj is Rigidbody) { return rigidbodyIcon; } if (obj is BoxCollider) { return boxColliderIcon; } if (obj is CapsuleCollider) { return capsuleColliderIcon; } if (obj is MeshCollider) { return meshColliderIcon; } if (obj is SphereCollider) { return sphereColliderIcon; } if (obj is TerrainCollider) { return terrainColliderIcon; } if (obj is WheelCollider) { return wheelColliderIcon; } if (obj is MeshFilter) { return meshFilterIcon; } if (obj is MeshRenderer) { return meshRendererIcon; } if (obj is MonoBehaviour) { return csScriptIcon; } if (obj is Font) { return fontIcon; } if (obj is LightProbes) { return lightProbeGroupIcon; } if (obj is LightProbeProxyVolume) { return lightProbeProxyVolumeIcon; } if (obj is LightProbeGroup) { return lightProbeGroupIcon; } if (obj is Material) { return materialIcon; } if (obj is Mesh) { return meshIcon; } if (obj is RenderTexture) { return renderTextureIcon; } if (obj is Texture2D) { return texture2DIcon; } if (obj is ScriptableObject) { return scriptableObjectIcon; } if (obj is Shader) { return shaderIcon; } if (obj is ShaderVariantCollection) { return shaderVariantCollectionIcon; } if (obj is ComputeShader) { return computeShaderIcon; } if (obj is Cubemap) { return cubemapIcon; } if (obj is Animation) { return animationIcon; } if (obj is FlareLayer) { return flareLayerIcon; } if (obj is Light) { Light light = (Light)obj; if (light.type == LightType.Directional) { return directionalLightIcon; } if (light.type == LightType.Point) { return pointLightIcon; } if (light.type == LightType.Spot) { return spotLightIcon; } if (light.type == LightType.Rectangle) { return areaLightIcon; } } return null; } public Texture GetIcon(Type type) { if (type == typeof(GameObject)) { return gameObjectIcon; } if (type == typeof(Transform)) { return transformIcon; } if (type == typeof(Camera)) { return cameraIcon; } if (type == typeof(AudioListener)) { return audioListenerIcon; } if (type == typeof(AudioSource)) { return audioSourceIcon; } if (type == typeof(Rigidbody)) { return rigidbodyIcon; } if (type == typeof(BoxCollider)) { return boxColliderIcon; } if (type == typeof(CapsuleCollider)) { return capsuleColliderIcon; } if (type == typeof(MeshCollider)) { return meshColliderIcon; } if (type == typeof(SphereCollider)) { return sphereColliderIcon; } if (type == typeof(TerrainCollider)) { return terrainColliderIcon; } if (type == typeof(WheelCollider)) { return wheelColliderIcon; } if (type == typeof(MeshFilter)) { return meshFilterIcon; } if (type == typeof(MeshRenderer)) { return meshRendererIcon; } if (type == typeof(Font)) { return fontIcon; } if (type == typeof(LightProbes)) { return lightProbeGroupIcon; } if (type == typeof(LightProbeProxyVolume)) { return lightProbeProxyVolumeIcon; } if (type == typeof(LightProbeGroup)) { return lightProbeGroupIcon; } if (type == typeof(Material)) { return materialIcon; } if (type == typeof(Mesh)) { return meshIcon; } if (type == typeof(RenderTexture)) { return renderTextureIcon; } if (type == typeof(Texture2D)) { return texture2DIcon; } if (type == typeof(Shader)) { return shaderIcon; } if (type == typeof(ShaderVariantCollection)) { return shaderVariantCollectionIcon; } if (type == typeof(ComputeShader)) { return computeShaderIcon; } if (type == typeof(Cubemap)) { return cubemapIcon; } if (type == typeof(Animation)) { return animationIcon; } if (type == typeof(FlareLayer)) { return flareLayerIcon; } if (type.IsSubclassOf(typeof(ScriptableObject))) { return scriptableObjectIcon; } if (type.IsSubclassOf(typeof(MonoBehaviour))) { return csScriptIcon; } if (type == typeof(Light)) { return pointLightIcon; } return null; } } }