Hello Guest

Author Topic: Tilemap material  (Read 3432 times)

DJVDJV

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 30
    • View Profile
Tilemap material
« 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?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap material
« Reply #1 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