Hello Guest

Author Topic: When is the combined mesh generated?  (Read 6486 times)

aninocoders

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
When is the combined mesh generated?
« on: June 03, 2013, 09:51:51 am »
We have an overlay sprite that we fade-in/fade-out whenever we change levels. This is just a simple interpolation of the alpha color and set it unto the sprite. This overlay is implemented as a non destroyable object that persists. What happens is that somehow a combined mesh ("Combined Mesh (root:scene)") is assigned to the MeshFilter of the sprite when the next level is loaded. So whatever color assigned to it no longer changes the color of the sprite.

I don't want this happening. How do I prevent it? It happens automatically.

aninocoders

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: When is the combined mesh generated?
« Reply #1 on: June 03, 2013, 10:04:08 am »
Found it. I unticked "Static". This feature may be useful but I think it's better if you use a different flag for it other than the built in "Static" flag.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: When is the combined mesh generated?
« Reply #2 on: June 03, 2013, 10:33:51 am »
A different flag than what? Sorry I don't think I follow - 2D Toolkit doesn't use the Unity static flag in any way.

aninocoders

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: When is the combined mesh generated?
« Reply #3 on: June 04, 2013, 03:44:52 am »
Somehow it stopped generating the combined mesh when static is unticked.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: When is the combined mesh generated?
« Reply #4 on: June 04, 2013, 10:45:16 am »
That sounds very much like Unitys static merging. Probably a good idea not to tick static unless your sprite is truly static. If you're changing colors, its not static.