UnityEditor.TextureUtil.GetMipmapCount C# (CSharp) Method

GetMipmapCount() private method

private GetMipmapCount ( Texture t ) : int
t UnityEngine.Texture
return int
        public static extern int GetMipmapCount(Texture t);
        [MethodImpl(MethodImplOptions.InternalCall)]

Usage Example

        protected Rect DoAlphaZoomToolbarGUI(Rect area)
        {
            int num = 1;

            if (this.m_Texture != null)
            {
                num = Mathf.Max(num, TextureUtil.GetMipmapCount(this.m_Texture));
            }
            Rect position = new Rect(area.width, 0f, 0f, area.height);

            using (new EditorGUI.DisabledScope(num == 1))
            {
                position.width = (float)this.m_Styles.largeMip.image.width;
                position.x    -= position.width;
                GUI.Box(position, this.m_Styles.largeMip, this.m_Styles.preLabel);
                position.width  = 60f;
                position.x     -= position.width;
                this.m_MipLevel = Mathf.Round(GUI.HorizontalSlider(position, this.m_MipLevel, (float)(num - 1), 0f, this.m_Styles.preSlider, this.m_Styles.preSliderThumb));
                position.width  = (float)this.m_Styles.smallMip.image.width;
                position.x     -= position.width;
                GUI.Box(position, this.m_Styles.smallMip, this.m_Styles.preLabel);
            }
            position.width   = 60f;
            position.x      -= position.width;
            this.m_Zoom      = GUI.HorizontalSlider(position, this.m_Zoom, this.GetMinZoom(), 50f, this.m_Styles.preSlider, this.m_Styles.preSliderThumb);
            position.width   = 32f;
            position.x      -= position.width + 5f;
            this.m_ShowAlpha = GUI.Toggle(position, this.m_ShowAlpha, (!this.m_ShowAlpha) ? this.m_Styles.RGBIcon : this.m_Styles.alphaIcon, "toolbarButton");
            return(new Rect(area.x, area.y, position.x, area.height));
        }
All Usage Examples Of UnityEditor.TextureUtil::GetMipmapCount