Open buihuuloc opened 6 years ago
Hi @buihuuloc
What is "destruction effect"? Do you have any images or videos of examples?
Hi You can check this open source. https://github.com/mjholtzem/Unity-2D-Destruction
Hmm...
The effect is so cool, but not for UI. It probably can be implemented for UI, but there are some disadvantages.
In this effect, Physics moves UI elements (with Rigidbody component). When the UI element moves, Canvas rebuilds the layout with overhead.
When dividing the mesh, it needs to be rendered as each mesh. It would be difficult to use other effects (such as UIShadow) together.
When implementing for UI, the compromise is as follows.
I see.
It can be implemented like a particle system. That is, the "particle" data array and the simulation function update the mesh. There is only one game object, component and renderer.
Implement the UIExplosion component as follows.
The nice thing about this implementation is "Canvas will not rebuild." Also, you do not need a shader, you can use it with other effects.
Hi @mob-sakai Have you ever think about this effect?