void _GenerateConfigInternal()
        {
            var atlasFolderPath        = AssetDatabase.GetAssetPath(AtlasFolder);
            var atlasFolderPathBuildIn = AssetDatabase.GetAssetPath(AtlasFolderBuildIn);

            //Debug.Log($"{atlasFolderPath} {atlasFolderPathBuildIn}");
            if (!AssetDatabase.IsValidFolder(atlasFolderPath))
            {
                EditorUtility.DisplayDialog(string.Empty, $"请正确设置图集文件夹!", "OK");
                return;
            }
            if (!AssetDatabase.IsValidFolder(atlasFolderPathBuildIn))
            {
                EditorUtility.DisplayDialog(string.Empty, $"请正确设置图集文件夹(build-in)!", "OK");
                return;
            }

            if (!_CheckAtlasName())
            {
                return;
            }
            //生成Atlas
            _GenerateSpriteAtlas(_GetAtlasFolders(AtlasConfsAB), atlasFolderPath, false);
            _GenerateSpriteAtlas(_GetAtlasFolders(AtlasConfsBI), atlasFolderPathBuildIn, true);

            //统计名字
            _GenerateTextureConfig();

            //
            XUITextureManager.InitEditor();
        }
示例#2
0
        private void Update()
        {
            if (Application.isPlaying)
            {
                return;
            }
            if (m_image.sprite != null && m_image.sprite.name != whiteblockName)
            {
                defaultTex     = m_image.sprite.name;
                m_image.sprite = null;
                EditorUtility.SetDirty(this);
            }
            if (m_image.sprite == null)
            {
                m_image.sprite = AssetDatabase.LoadAssetAtPath <Sprite>(whiteblockPath);
            }

            if (m_image.overrideSprite == null || m_image.overrideSprite.name != defaultTex)
            {
                m_image.overrideSprite = XUITextureManager.GetSpriteEditor(defaultTex);
            }
        }