UnityEditor.CubemapPreview.GetMipLevelForRendering C# (CSharp) Method

GetMipLevelForRendering() public method

public GetMipLevelForRendering ( Texture texture ) : float
texture UnityEngine.Texture
return float
        public float GetMipLevelForRendering(Texture texture)
        {
            return Mathf.Min(this.m_MipLevel, (float) TextureUtil.GetMipmapCount(texture));
        }

Usage Example

        public float GetMipLevelForRendering()
        {
            if (target == null)
            {
                return(0.0f);
            }

            if (IsCubemap())
            {
                return(m_CubemapPreview.GetMipLevelForRendering(target as Texture));
            }
            else
            {
                return(Mathf.Min(m_MipLevel, TextureUtil.GetMipmapCount(target as Texture) - 1));
            }
        }