public static void BeginSolidLines()
 {
     InternalEditorBridge.ApplyWireMaterial();
     GL.PushMatrix();
     GL.MultMatrix(Handles.matrix);
     GL.Begin(GL.TRIANGLES);
 }
Beispiel #2
0
        static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
        {
            m_AssetList = new List <object>();
            List <string> assetPathModified = new List <string>();

            foreach (var importedAsset in importedAssets)
            {
                ISpriteEditorDataProvider ai = InternalEditorBridge.GetISpriteEditorDataProviderFromPath(importedAsset);
                if (ai != null)
                {
                    ai.InitSpriteEditorDataProvider();
                    var  assets      = AssetDatabase.LoadAllAssetsAtPath(importedAsset);
                    var  sprites     = assets.OfType <Sprite>().ToArray <Sprite>();
                    bool dataChanged = false;
                    dataChanged  = PostProcessBoneData(ai, sprites);
                    dataChanged |= PostProcessSpriteMeshData(ai, sprites);
                    if (dataChanged)
                    {
                        assetPathModified.Add(importedAsset);
                        m_AssetList.AddRange(assets);
                    }
                }
            }

            if (assetPathModified.Count > 0 && m_AssetList.Count > 0)
            {
                var originalValue = EditorPrefs.GetBool("VerifySavingAssets", false);
                EditorPrefs.SetBool("VerifySavingAssets", false);
                AssetDatabase.ForceReserializeAssets(assetPathModified, ForceReserializeAssetsOptions.ReserializeMetadata);
                EditorPrefs.SetBool("VerifySavingAssets", originalValue);
                m_AssetList.Clear();
            }
        }
 private void OnProjectLoaded()
 {
     if (m_ShortcutContext != null)
     {
         InternalEditorBridge.RegisterShortcutContext(m_ShortcutContext);
     }
 }
        public static void DrawLine(Vector3 p1, Vector3 p2, Vector3 normal, float widthP1, float widthP2, Color color)
        {
            if (Event.current.type != EventType.Repaint)
            {
                return;
            }

            Vector3 right = Vector3.Cross(normal, p2 - p1).normalized;

            Shader.SetGlobalFloat("_HandleSize", 1);

            InternalEditorBridge.ApplyWireMaterial();
            GL.PushMatrix();
            GL.MultMatrix(Handles.matrix);
            GL.Begin(4);
            GL.Color(color);
            GL.Vertex(p1 + right * widthP1 * 0.5f);
            GL.Vertex(p1 - right * widthP1 * 0.5f);
            GL.Vertex(p2 - right * widthP2 * 0.5f);
            GL.Vertex(p1 + right * widthP1 * 0.5f);
            GL.Vertex(p2 - right * widthP2 * 0.5f);
            GL.Vertex(p2 + right * widthP2 * 0.5f);
            GL.End();
            GL.PopMatrix();
        }
Beispiel #5
0
        private void AddMainUI(VisualElement mainView)
        {
            var           visualTree = ResourceLoader.Load <VisualTreeAsset>("LayoutOverlay/LayoutOverlay.uxml");
            VisualElement clone      = visualTree.CloneTree();

            m_LayoutOverlay = clone.Q <LayoutOverlay>("LayoutOverlay");

            mainView.Add(m_LayoutOverlay);
            m_LayoutOverlay.hasScrollbar = true;
            m_LayoutOverlay.verticalToolbar.verticalScrollerVisibility = ScrollerVisibility.Hidden;
            m_LayoutOverlay.StretchToParentSize();

            CreatePoseToolbar();
            CreateBoneToolbar();
            CreateMeshToolbar();
            CreateWeightToolbar();
            CreateRigToolbar();

            m_ShortcutContext = new InternalEditorBridge.ShortcutContext()
            {
                isActive = isFocused,
                context  = this
            };
            InternalEditorBridge.RegisterShortcutContext(m_ShortcutContext);
            InternalEditorBridge.AddEditorApplicationProjectLoadedCallback(OnProjectLoaded);
        }
        public static void DrawSolidArc(Vector3 center, Vector3 normal, Vector3 from, float angle, float radius, int numSamples = 60)
        {
            if (Event.current.type != EventType.Repaint)
            {
                return;
            }

            numSamples = Mathf.Clamp(numSamples, 3, 60);

            if (s_array == null)
            {
                s_array = new Vector3[60];
            }

            Color color = Handles.color;

            SetDiscSectionPoints(s_array, numSamples, normal, from, angle);
            InternalEditorBridge.ApplyWireMaterial();
            GL.PushMatrix();
            GL.MultMatrix(Handles.matrix);
            GL.Begin(GL.TRIANGLES);
            for (int i = 1; i < numSamples; i++)
            {
                GL.Color(color);
                GL.Vertex(center);
                GL.Vertex(center + s_array[i - 1] * radius);
                GL.Vertex(center + s_array[i] * radius);
            }
            GL.End();
            GL.PopMatrix();
        }
 public static void BeginLines(Color color)
 {
     InternalEditorBridge.ApplyWireMaterial();
     GL.PushMatrix();
     GL.MultMatrix(Handles.matrix);
     GL.Begin(GL.LINES);
     GL.Color(color);
 }
        private static void RegisterShortcuts()
        {
            m_ShortcutContext = new InternalEditorBridge.ShortcutContext()
            {
                isActive = () => m_SpriteShapeTool.isActive,
                context  = m_SpriteShapeTool
            };

            InternalEditorBridge.RegisterShortcutContext(m_ShortcutContext);
        }
Beispiel #9
0
        private void RegisterShortcuts()
        {
            m_ShortcutContext = new InternalEditorBridge.ShortcutContext()
            {
                isActive = () => GUIUtility.hotControl == 0,
                context  = this
            };

            InternalEditorBridge.RegisterShortcutContext(m_ShortcutContext);
        }
        void RenderSortingLayerFields()
        {
            if (m_MeshRendererSO != null)
            {
                m_MeshRendererSO.Update();

                InternalEditorBridge.RenderSortingLayerFields(m_SortingOrderProp, m_SortingLayerProp);

                m_MeshRendererSO.ApplyModifiedProperties();
            }
        }
        public void GenerateOutline(ITextureDataProvider textureDataProvider, Rect rect, float detail, byte alphaTolerance, bool holeDetection, out Vector2[][] paths)
        {
            if (alphaTolerance >= 255)
            {
                throw new ArgumentException("Alpha tolerance should be lower than 255");
            }

            m_CurrentTexture        = textureDataProvider.GetReadableTexture2D();
            m_CurrentRect           = rect;
            m_CurrentAlphaTolerance = alphaTolerance;

            InternalEditorBridge.GenerateOutline(textureDataProvider.texture, rect, 1f, alphaTolerance, holeDetection, out paths);

            if (paths.Length > 0)
            {
                ClipPaths(ref paths);

                Debug.Assert(paths.Length > 0);

                var rectSizeMagnitude = rect.size.magnitude;
                var minDistance       = Mathf.Max(rectSizeMagnitude / 10f, kMinLinearizeDistance);
                var maxDistance       = Mathf.Max(rectSizeMagnitude / 100f, kMinLinearizeDistance);
                var distance          = Mathf.Lerp(minDistance, maxDistance, detail);

                for (var pathIndex = 0; pathIndex < paths.Length; ++pathIndex)
                {
                    var pathLength = CalculatePathLength(paths[pathIndex]);
                    if (pathLength > distance)
                    {
                        var newPath = Linearize(new List <Vector2>(paths[pathIndex]), distance);

                        if (newPath.Count > 3)
                        {
                            paths[pathIndex] = newPath.ToArray();
                        }

                        SmoothPath(paths[pathIndex], 5, 0.1f, 135f);
                    }
                }

                ClipPaths(ref paths);
            }

            // Merge the Polygons to one (doesn't always succeeds).
            var clipper  = new Clipper(Clipper.ioPreserveCollinear);
            var subj     = ToClipper(paths);
            var solution = new Paths();

            clipper.AddPaths(subj, PolyType.ptSubject, true);
            clipper.Execute(ClipType.ctUnion, solution, PolyFillType.pftNonZero, PolyFillType.pftNonZero);
            paths = ToVector2(solution);
            m_CurrentAlphaTolerance = alphaTolerance;
        }
 public Texture2D GetReadableTexture2D()
 {
     if (m_ReadableTexture == null)
     {
         m_ReadableTexture = InternalEditorBridge.CreateTemporaryDuplicate(texture, texture.width, texture.height);
         if (m_ReadableTexture != null)
         {
             m_ReadableTexture.filterMode = texture.filterMode;
         }
     }
     return(m_ReadableTexture);
 }
        public static Vector3 Snap(Vector3 position)
        {
            if (!enabled)
            {
                return(position);
            }

            return(new Vector3(
                       Snap(position.x, InternalEditorBridge.GetSnapSettingMove().x),
                       Snap(position.y, InternalEditorBridge.GetSnapSettingMove().y),
                       position.z
                       ));
        }
            public override void Action(int instanceId, string pathName, string resourceFile)
            {
                var uniqueName = AssetDatabase.GenerateUniqueAssetPath(pathName);
                // ProjectWindowUtil.StartNameEditingIfProjectWindowExists(int instanceID, EndNameEditAction endAction, string pathName, Texture2D icon, string resourceFile)
                // will reset the instanceId to Int32.MaxValue - 1 if its 0. Looks like a new trunk change ?
                var validInstanceId = (instanceId != 0 && instanceId != InternalEditorBridge.GetAssetCreationInstanceID_ForNonExistingAssets());

                if (!validInstanceId && !string.IsNullOrEmpty(resourceFile))
                {
                    AssetDatabase.CopyAsset(resourceFile, uniqueName);
                }
                else
                {
                    var obj = EditorUtility.InstanceIDToObject(instanceId);
                    AssetDatabase.CreateAsset(obj, uniqueName);
                }
            }
        public void GenerateOutline(ITextureDataProvider textureDataProvider, Rect rect, float detail, byte alphaTolerance, bool holeDetection, out Vector2[][] paths)
        {
            if (alphaTolerance >= 255)
            {
                throw new ArgumentException("Alpha tolerance should be lower than 255");
            }

            m_CurrentTexture        = textureDataProvider.GetReadableTexture2D();
            m_CurrentRect           = rect;
            m_CurrentAlphaTolerance = alphaTolerance;

            InternalEditorBridge.GenerateOutline(textureDataProvider.texture, rect, 1f, alphaTolerance, holeDetection, out paths);

            if (paths.Length > 0)
            {
                ClipPaths(ref paths);

                Debug.Assert(paths.Length > 0);

                var rectSizeMagnitude = rect.size.magnitude;
                var minDistance       = Mathf.Max(rectSizeMagnitude / 10f, kMinLinearizeDistance);
                var maxDistance       = Mathf.Max(rectSizeMagnitude / 100f, kMinLinearizeDistance);
                var distance          = Mathf.Lerp(minDistance, maxDistance, detail);

                for (var pathIndex = 0; pathIndex < paths.Length; ++pathIndex)
                {
                    var pathLength = CalculatePathLength(paths[pathIndex]);
                    if (pathLength > distance)
                    {
                        var newPath = Linearize(new List <Vector2>(paths[pathIndex]), distance);

                        if (newPath.Count > 3)
                        {
                            paths[pathIndex] = newPath.ToArray();
                        }

                        SmoothPath(paths[pathIndex], 5, 0.1f, 135f);
                    }
                }

                ClipPaths(ref paths);
            }
        }
        private void AddMainUI(VisualElement mainView)
        {
            var           visualTree = Resources.Load("LayoutOverlay") as VisualTreeAsset;
            VisualElement clone      = visualTree.CloneTree(null);

            m_LayoutOverlay = clone.Q <LayoutOverlay>("LayoutOverlay");

            mainView.Add(m_LayoutOverlay);
            m_LayoutOverlay.hasScrollbar = true;
            m_LayoutOverlay.StretchToParentSize();

            CreateBoneToolbar();
            CreateMeshToolbar();
            CreateWeightToolbar();

            m_ShortcutContext         = InternalEditorBridge.CreateShortcutContext(isFocused);
            m_ShortcutContext.context = this;
            InternalEditorBridge.RegisterShortcutContext(m_ShortcutContext);
            InternalEditorBridge.AddEditorApplicationProjectLoadedCallback(OnProjectLoaded);
        }
        static public T CreateAssetObject <T>(T obj) where T : UnityEngine.Object
        {
            var assetSelectionPath = AssetDatabase.GetAssetPath(Selection.activeObject);
            var isFolder           = false;

            if (!string.IsNullOrEmpty(assetSelectionPath))
            {
                isFolder = File.GetAttributes(assetSelectionPath).HasFlag(FileAttributes.Directory);
            }
            var path = InternalEditorBridge.GetProjectWindowActiveFolderPath();

            if (isFolder)
            {
                path = assetSelectionPath;
            }

            string resourceFile = "";
            string destName     = "";
            int    instanceId   = 0;
            string fileName     = "";

            if (obj != null)
            {
                resourceFile = AssetDatabase.GetAssetPath(obj);
                fileName     = System.IO.Path.GetFileName(resourceFile);
            }
            else
            {
                obj        = ObjectFactory.CreateInstance <T>();
                instanceId = obj.GetInstanceID();
                fileName   = "Sprite Shape Profile.asset";
            }
            destName = AssetDatabase.GenerateUniqueAssetPath(System.IO.Path.Combine(path, fileName));
            var icon = AssetPreview.GetMiniThumbnail(obj);

            StartNewAssetNameEditing(resourceFile, destName, icon, instanceId);
            return(Selection.activeObject as T);
        }
Beispiel #18
0
 private void UnregisterShortcuts()
 {
     InternalEditorBridge.UnregisterShortcutContext(m_ShortcutContext);
 }
Beispiel #19
0
        public override void OnInspectorGUI()
        {
            m_CurrentInspectorWindow = InternalEditorBridge.GetCurrentInspectorWindow();

            if (m_CurrentInspectorWindow)
            {
                m_CurrentInspectorWindow.wantsMouseMove = GUIUtility.hotControl == 0;
            }

            serializedObject.Update();

            EditorGUILayout.Space();
            DrawHeader(Contents.controlPointsLabel);
            EditorGUILayout.PropertyField(m_UseSpriteBordersProp, Contents.useSpriteBorderLabel);
            EditorGUILayout.Slider(m_BevelCutoffProp, 0f, 180f, Contents.bevelCutoffLabel);
            EditorGUILayout.Slider(m_BevelSizeProp, 0.0f, 0.5f, Contents.bevelSizeLabel);


            EditorGUILayout.Space();
            DrawHeader(Contents.fillLabel);
            EditorGUILayout.PropertyField(m_FillTextureProp, Contents.fillTextureLabel);
            EditorGUILayout.PropertyField(m_FillPixelPerUnitProp, Contents.fillPixelPerUnitLabel);
            EditorGUILayout.PropertyField(m_WorldSpaceUVProp);
            EditorGUILayout.Slider(m_FillOffsetProp, -0.5f, 0.5f, Contents.fillScaleLabel);


            if (m_FillTextureProp.objectReferenceValue != null)
            {
                var fillTex = m_FillTextureProp.objectReferenceValue as Texture2D;
                if (fillTex.wrapModeU != TextureWrapMode.Repeat || fillTex.wrapModeV != TextureWrapMode.Repeat)
                {
                    EditorGUILayout.HelpBox(Contents.wrapModeErrorLabel.text, MessageType.Info);
                }
            }

            EditorGUILayout.Space();
            DrawHeader(Contents.angleRangesLabel);
            DoRangesGUI();

            if (targets.Length == 1)
            {
                m_FadeAngleRange.target = m_CurrentAngleRange != null;
                if (EditorGUILayout.BeginFadeGroup(m_FadeAngleRange.faded))
                {
                    if (m_FadeAngleRange.target)
                    {
                        DoRangeInspector();
                    }
                }

                EditorGUILayout.EndFadeGroup();

                DoCreateRangeButton();
            }

            EditorGUILayout.Space();
            DrawHeader(Contents.cornerLabel);

            EditorGUIUtility.labelWidth = EditorGUIUtility.labelWidth + 20f;

            for (int i = 0; i < m_CornerSpritesProp.arraySize; ++i)
            {
                var m_CornerProp   = m_CornerSpritesProp.GetArrayElementAtIndex(i);
                var m_CornerType   = m_CornerProp.FindPropertyRelative("m_CornerType");
                var m_CornerSprite = m_CornerProp.FindPropertyRelative("m_Sprites").GetArrayElementAtIndex(0);

                EditorGUILayout.PropertyField(m_CornerSprite, new GUIContent(m_CornerType.enumDisplayNames[m_CornerType.intValue]));
            }

            EditorGUIUtility.labelWidth = 0;

            serializedObject.ApplyModifiedProperties();

            HandleRepaintOnHover();

            controller.view.DoCreateRangeTooltip();
        }
Beispiel #20
0
 public void GenerateOutline(Texture2D texture, Rect rect, float detail, byte alphaTolerance, bool holeDetection, out Vector2[][] paths)
 {
     InternalEditorBridge.GenerateOutline(texture, rect, detail, alphaTolerance, holeDetection, out paths);
 }
 private void RemoveMainUI(VisualElement mainView)
 {
     InternalEditorBridge.RemoveEditorApplicationProjectLoadedCallback(OnProjectLoaded);
     InternalEditorBridge.UnregisterShortcutContext(m_ShortcutContext);
 }
        void CommonTextureSettingsGUI()
        {
            EditorGUI.BeginChangeCheck();

            // Wrap mode
            bool isVolume = false;

            WrapModePopup(m_WrapU, m_WrapV, m_WrapW, isVolume, ref m_ShowPerAxisWrapModes);


            // Display warning about repeat wrap mode on restricted npot emulation
            if (m_NPOTScale.intValue == (int)TextureImporterNPOTScale.None &&
                (m_WrapU.intValue == (int)TextureWrapMode.Repeat || m_WrapV.intValue == (int)TextureWrapMode.Repeat) &&
                !InternalEditorBridge.DoesHardwareSupportsFullNPOT())
            {
                bool displayWarning = false;
                foreach (var target in targets)
                {
                    var imp = (PSDImporter)target;
                    int w   = imp.textureActualWidth;
                    int h   = imp.textureActualHeight;
                    if (!Mathf.IsPowerOfTwo(w) || !Mathf.IsPowerOfTwo(h))
                    {
                        displayWarning = true;
                        break;
                    }
                }

                if (displayWarning)
                {
                    EditorGUILayout.HelpBox(s_Styles.warpNotSupportWarning.text, MessageType.Warning, true);
                }
            }

            // Filter mode
            EditorGUI.showMixedValue = m_FilterMode.hasMultipleDifferentValues;
            FilterMode filter = (FilterMode)m_FilterMode.intValue;

            if ((int)filter == -1)
            {
                if (m_FadeOut.intValue > 0 || m_ConvertToNormalMap.intValue > 0)
                {
                    filter = FilterMode.Trilinear;
                }
                else
                {
                    filter = FilterMode.Bilinear;
                }
            }
            filter = (FilterMode)EditorGUILayout.IntPopup(s_Styles.filterMode, (int)filter, s_Styles.filterModeOptions, m_FilterModeOptions);
            EditorGUI.showMixedValue = false;
            if (EditorGUI.EndChangeCheck())
            {
                m_FilterMode.intValue = (int)filter;
            }

            // Aniso
            bool showAniso = (FilterMode)m_FilterMode.intValue != FilterMode.Point &&
                             m_EnableMipMap.intValue > 0 &&
                             (TextureImporterShape)m_TextureShape.intValue != TextureImporterShape.TextureCube;

            using (new EditorGUI.DisabledScope(!showAniso))
            {
                EditorGUI.BeginChangeCheck();
                EditorGUI.showMixedValue = m_Aniso.hasMultipleDifferentValues;
                int aniso = m_Aniso.intValue;
                if (aniso == -1)
                {
                    aniso = 1;
                }
                aniso = EditorGUILayout.IntSlider(s_Styles.anisoLevelLabel, aniso, 0, 16);
                EditorGUI.showMixedValue = false;
                if (EditorGUI.EndChangeCheck())
                {
                    m_Aniso.intValue = aniso;
                }

                if (aniso > 1)
                {
                    if (QualitySettings.anisotropicFiltering == AnisotropicFiltering.Disable)
                    {
                        EditorGUILayout.HelpBox(s_Styles.anisotropicDisableInfo.text, MessageType.Info);
                    }
                    else if (QualitySettings.anisotropicFiltering == AnisotropicFiltering.ForceEnable)
                    {
                        EditorGUILayout.HelpBox(s_Styles.anisotropicForceEnableInfo.text, MessageType.Info);
                    }
                }
            }
        }
        void DoSpriteInspector()
        {
            EditorGUI.BeginChangeCheck();
            EditorGUILayout.IntPopup(m_SpriteMode, s_Styles.spriteModeOptions, new[] { 1, 2, 3 }, s_Styles.spriteMode);

            // Ensure that PropertyField focus will be cleared when we change spriteMode.
            if (EditorGUI.EndChangeCheck())
            {
                GUIUtility.keyboardControl = 0;
            }

            EditorGUI.indentLevel++;

            // Show generic attributes
            if (m_SpriteMode.intValue != 0)
            {
                EditorGUILayout.PropertyField(m_SpritePixelsToUnits, s_Styles.spritePixelsPerUnit);

                if (m_SpriteMode.intValue != (int)SpriteImportMode.Polygon && !m_SpriteMode.hasMultipleDifferentValues)
                {
                    EditorGUILayout.IntPopup(m_SpriteMeshType, s_Styles.spriteMeshTypeOptions, new[] { 0, 1 }, s_Styles.spriteMeshType);
                }

                EditorGUILayout.IntSlider(m_SpriteExtrude, 0, 32, s_Styles.spriteExtrude);

                if (m_SpriteMode.intValue == 1)
                {
                    EditorGUILayout.IntPopup(m_Alignment, s_Styles.spriteAlignmentOptions, new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s_Styles.spriteAlignment);

                    if (m_Alignment.intValue == (int)SpriteAlignment.Custom)
                    {
                        GUILayout.BeginHorizontal();
                        EditorGUILayout.PropertyField(m_SpritePivot, new GUIContent());
                        GUILayout.EndHorizontal();
                    }
                }
            }

            EditorGUILayout.PropertyField(m_ImportHiddenLayers, s_Styles.importHiddenLayer);
            if (m_SpriteMode.intValue == (int)SpriteImportMode.Multiple && !m_SpriteMode.hasMultipleDifferentValues)
            {
                EditorGUILayout.PropertyField(m_MosaicLayers, s_Styles.mosaicLayers);

                using (new EditorGUI.DisabledScope(!m_MosaicLayers.boolValue))
                {
                    EditorGUILayout.PropertyField(m_CharacterMode, s_Styles.characterMode);
                    using (new EditorGUI.DisabledScope(!m_CharacterMode.boolValue))
                    {
                        EditorGUILayout.PropertyField(m_GenerateGOHierarchy, s_Styles.generateGOHierarchy);
                        EditorGUILayout.IntPopup(m_DocumentAlignment, s_Styles.spriteAlignmentOptions, new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s_Styles.characterAlignment);
                        if (m_DocumentAlignment.intValue == (int)SpriteAlignment.Custom)
                        {
                            GUILayout.BeginHorizontal();
                            GUILayout.Space(EditorGUIUtility.labelWidth);
                            EditorGUILayout.PropertyField(m_DocumentPivot, new GUIContent());
                            GUILayout.EndHorizontal();
                        }
                    }


                    EditorGUILayout.PropertyField(m_ResliceFromLayer, s_Styles.resliceFromLayer);
                    if (m_ResliceFromLayer.boolValue)
                    {
                        EditorGUILayout.HelpBox(s_Styles.resliceFromLayerWarning.text, MessageType.Info, true);
                    }
                }
            }

            using (new EditorGUI.DisabledScope(targets.Length != 1))
            {
                GUILayout.BeginHorizontal();

                GUILayout.FlexibleSpace();
                if (GUILayout.Button(s_Styles.spriteEditorButtonLabel))
                {
                    if (HasModified())
                    {
                        // To ensure Sprite Editor Window to have the latest texture import setting,
                        // We must applied those modified values first.
                        string dialogText = string.Format(s_Styles.unappliedSettingsDialogContent.text, ((AssetImporter)target).assetPath);
                        if (EditorUtility.DisplayDialog(s_Styles.unappliedSettingsDialogTitle.text,
                                                        dialogText, s_Styles.applyButtonLabel.text, s_Styles.revertButtonLabel.text))
                        {
                            ApplyAndImport();
                            InternalEditorBridge.ShowSpriteEditorWindow();

                            // We reimported the asset which destroyed the editor, so we can't keep running the UI here.
                            GUIUtility.ExitGUI();
                        }
                    }
                    else
                    {
                        InternalEditorBridge.ShowSpriteEditorWindow();
                    }
                }
                GUILayout.EndHorizontal();
            }
            EditorGUI.indentLevel--;
        }