2D Toolkit Forum

2D Toolkit => Support => Topic started by: DJVDJV on October 30, 2015, 08:20:21 pm

Title: Tilemap material
Post by: DJVDJV on October 30, 2015, 08:20:21 pm
Hi,

I try change tilemap material at runtime like:
 backGroundTileMap.SpriteCollectionInst.material = backGroundTileMap.SpriteCollectionInst.materials[1];
 backGroundTileMap.Build();

 backGroundTileMap.SpriteCollectionInst.materials[0] is normal material.
 backGroundTileMap.SpriteCollectionInst.materials[1] is custom material.

But it does not seems change.. what I do wrong?
Title: Re: Tilemap material
Post by: unikronsoftware on November 03, 2015, 12:08:10 pm
You'll have to forcebuild for it to update it like that. Shouldn't do that at runtime unless absolutely necessary as it is really really expensive though, you might be better off assigning a material, then changing the material itself at runtime