UnityEditor.SpriteInspector.OnPreviewGUI C# (CSharp) Method

OnPreviewGUI() public method

public OnPreviewGUI ( Rect r, GUIStyle background ) : void
r UnityEngine.Rect
background UnityEngine.GUIStyle
return void
        public override void OnPreviewGUI(Rect r, GUIStyle background)
        {
            if ((base.target != null) && (Event.current.type == EventType.Repaint))
            {
                bool isPolygon = false;
                TextureImporter atPath = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(this.sprite)) as TextureImporter;
                if (atPath != null)
                {
                    isPolygon = atPath.spriteImportMode == SpriteImportMode.Polygon;
                }
                DrawPreview(r, this.sprite, null, isPolygon);
            }
        }