コード例 #1
0
 static SpriteEditorWindow()
 {
     UnityEditor.SpriteUtilityWindow.SetShowSpriteEditorWindow(() =>
     {
         SpriteEditorWindow.GetWindow();
         return(true);
     });
 }
コード例 #2
0
 static internal void OnTextureReimport(SpriteEditorWindow win, string path)
 {
     if (win.m_SelectedAssetPath == path)
     {
         win.m_ResetOnNextRepaint = true;
         win.Repaint();
     }
 }
コード例 #3
0
        static internal void OnTextureReimport(string path)
        {
            UnityEngine.Object[] wins = Resources.FindObjectsOfTypeAll(typeof(SpriteEditorWindow));
            SpriteEditorWindow   win  = wins.Length > 0 ? (EditorWindow)(wins[0]) as SpriteEditorWindow : null;

            if (win != null && win.m_SelectedAssetPath == path)
            {
                win.m_ResetOnNextRepaint = true;
                win.Repaint();
            }
        }
コード例 #4
0
        static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
        {
            foreach (var deletedAsset in deletedAssets)
            {
                SpriteEditorWindow.OnTextureReimport(deletedAsset);
            }

            foreach (var importedAsset in importedAssets)
            {
                SpriteEditorWindow.OnTextureReimport(importedAsset);
            }
        }
コード例 #5
0
        static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
        {
            UnityEngine.Object[] wins = Resources.FindObjectsOfTypeAll(typeof(SpriteEditorWindow));
            SpriteEditorWindow   win  = wins.Length > 0 ? (EditorWindow)(wins[0]) as SpriteEditorWindow : null;

            if (win != null)
            {
                foreach (var deletedAsset in deletedAssets)
                {
                    SpriteEditorWindow.OnTextureReimport(win, deletedAsset);
                }

                foreach (var importedAsset in importedAssets)
                {
                    SpriteEditorWindow.OnTextureReimport(win, importedAsset);
                }
            }
        }
コード例 #6
0
 static private void OpenSpriteEditorWindow()
 {
     SpriteEditorWindow.GetWindow();
 }