Notifications
Article
Mesh Slicer
Published 5 months ago
46
0
The process of slicing
Package on asset store: https://assetstore.unity.com/packages/tools/modeling/mesh-slicer-59618
The main stages of slicing is:
  1. Preparing data
  2. Find all renderers with meshes
  3. Slice meshes
  4. Finish

Preparing data stage

Here, in PrepareData method, you can do some pre-calculations and store it in slice data, it will be returned to you in finish method. For example, you can save the Id of the person who is going to chop the enemy's head and then get it in OnSliceFinished method. It is important in asynchronous mode, because you may have a lot of slicing at the same time and you do not know how was initiator of successful one.

Slice meshes

The plugin tries to slice each mesh separately. If, after slice, validation is not success, it do not slice this mesh.
The whole slice is success if we have meshes on both sides of the plane, even if no meshes was sliced.

Finish

Apply changes and invoke event handlers. I believe nothing is needed to be clarified there.

Stas Bz
Stas - Programmer
3
Comments