Switching Texture in runtime

Let's say we have 3D object with the TPHelper script attached


Let's create the Controller script with public helper filed:

public TPHelper helper;


And drag and drop our 3D object to this helper filed

To switch texture from the same atlas we can use:



If we need to switch texture from another atlas, we also need to switch object atlas as well before applying new texture name:

if(!helper.atlasPath.Equals(AtlasPath2))  {


The full example can be found under the RuntimeAtlasTextureSwitch example scene.