How to get access to the texture generated by built-in Sprite Packer?

I have a tile map which takes sprites from my assets and combines them into one mesh. Now I need to assign material with the atlas texture generated for sprites (sprite atlas).

The problem is that when I take material from one sprite that uses the atlas I need, and assign that material to the map, I get a material with no texture. And attempts to get texture from the sprite return null.

How do I get the sprite atlas texture?

Try the Sprite Utility GetSpriteTexture with true as second parameter and set the texture to your material. Other wise Paker.GetAtlasDataForSprite can be helpful in your case.

Sprite sAry = new Sprite[_spriteAtlas.spriteCount];
Texture2D t = sAry[0].texture;
This is working for me.