Hello Guest

Author Topic: How to keep custom shader setting when changing the sprite?  (Read 4137 times)

unity_stark

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
I follow your suggestion last time and create the custom shader and palette.
Now it's working! Thanks a lot!

But now I encounter the new problem.
Every time when I change the sprite at run time, it seems lost the connection between atlas0 material and custom shader.
The sprite can't display correctly.

I have to set the custom shader again after I change the sprite.

Do you have any suggestions?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How to keep custom shader setting when changing the sprite?
« Reply #1 on: June 26, 2013, 09:14:55 pm »
You should assign it to atlas 0 material in the inspector before the game starts.
That will assign it on all sprites using that collection.