private void UpdateCachedTexture(GITextureType textureType)
        {
            if (isIndexBased)
            {
                if (isRealtimeLightmap)
                {
                    Hash128[] mainHashes = LightmapEditorSettings.GetMainSystemHashes();

                    if (!m_RealtimeTextureHash.isValid || !mainHashes.Contains(m_RealtimeTextureHash))
                    {
                        m_RealtimeTextureHash = mainHashes.ElementAtOrDefault(m_LightmapIndex);
                    }
                }
            }
            else
            {
                if (isRealtimeLightmap)
                {
                    Hash128 systemHash;

                    if (!LightmapEditorSettings.GetInputSystemHash(instanceID, out systemHash))
                    {
                        return;
                    }

                    m_RealtimeTextureHash = systemHash;
                }
                else
                {
                    int lightmapIndex;

                    if (!LightmapEditorSettings.GetLightmapIndex(instanceID, out lightmapIndex))
                    {
                        return;
                    }

                    m_LightmapIndex = lightmapIndex;
                }
            }

            Hash128 contentHash = isRealtimeLightmap ? LightmapVisualizationUtility.GetRealtimeGITextureHash(m_RealtimeTextureHash, textureType) :
                                  LightmapVisualizationUtility.GetBakedGITextureHash(m_LightmapIndex, 0, textureType);

            // if we need to fetch a new texture
            if (m_CachedTexture.texture == null || m_CachedTexture.type != textureType || m_CachedTexture.contentHash != contentHash || m_CachedTexture.contentHash == new Hash128())
            {
                m_CachedTexture = isRealtimeLightmap ?
                                  LightmapVisualizationUtility.GetRealtimeGITexture(m_RealtimeTextureHash, textureType) :
                                  LightmapVisualizationUtility.GetBakedGITexture(m_LightmapIndex, 0, textureType);
            }

            if (!m_ShowUVOverlay)
            {
                return; // if we don't wanna show any overlay
            }
            if (m_CachedTexture.texture == null || m_CachedTexture.textureAvailability == GITextureAvailability.GITextureNotAvailable || m_CachedTexture.textureAvailability == GITextureAvailability.GITextureUnknown)
            {
                return; // if we dont have a texture
            }
            // fetch Renderers

            if (isRealtimeLightmap)
            {
                m_CachedTextureObjects = LightmapVisualizationUtility.GetRealtimeGITextureRenderers(m_RealtimeTextureHash);
            }
            else
            {
                m_CachedTextureObjects = LightmapVisualizationUtility.GetBakedGITextureRenderers(m_LightmapIndex);
            }
        }