예제 #1
0
        private void _SetAtlas(UIAtlas atlas)
        {
            _atlas = atlas;

            if (null == atlas)
            {
                return;
            }

            var richText          = _richText;
            var mat               = richText.material;
            var manager           = MaterialManager.Instance;
            var lastSpriteTexture = manager.GetSpriteAtlas(mat);
            var spriteTexture     = atlas.GetTexture();

            var isTextureChanged = lastSpriteTexture != spriteTexture;

            if (isTextureChanged)
            {
                manager.DetachTexture(richText, lastSpriteTexture);
                manager.AttachTexture(richText, spriteTexture);
            }
        }