Subscribe with the component lifecycle#
Detailed slice events run synchronously on the main thread. Subscribe in OnEnable, unsubscribe in OnDisable, and keep handlers brief. The guide states that handler exceptions are isolated/logged and recursive same-object slicing from a slice callback is rejected.
This contextual fragment assumes an assigned target and your own HandleSlice / HandleReassemble handlers:
private void OnEnable()
{
target.OnSliceCompleted += HandleSlice;
target.OnReassembleRequested += HandleReassemble;
}
private void OnDisable()
{
target.OnSliceCompleted -= HandleSlice;
target.OnReassembleRequested -= HandleReassemble;
}Follow the request lifecycle#
| Event | Stage |
|---|---|
OnSliceStarted | Request processing begins. |
OnSliceValidated | Geometry, limits and pool preflight passed; live state is about to change. |
OnSliceCompleted | Result and metadata have been committed. |
OnFragmentCreated | Each new child after completion. |
OnSliceFailed | A request was rejected. |
OnReassembleRequested | Restoration begins, before fragment handles retire. |
Slice events carry RuntimeSliceEvent with Kind, Result and, for fragment creation, Fragment. Existing whole-object lifecycle events include Destroyed and Restored.
OnSliceValidated signals successful preflight. It does not guarantee that unrelated application callbacks cannot subsequently interrupt game logic.
Restore the source#
Reassemble() restores the original source object and invalidates active runtime fragment handles. It is restoration rather than recorded reverse playback. Expired pieces cannot animate back, but the source still restores.
Reassembly clears the prior ancestry tree. Discard stored fragment handles and IDs from that previous cycle; resolve fresh references for new cuts.
Exported children restore independently#
A combined prefab exported from the Manual Slice Editor contains independently destructible children. Calling Reassemble() on one child restores that child's exported fragment Sprite. It does not join siblings or rebuild their unsliced parent artwork.
Read prefab export when choosing between a single runtime source and several exported destructible objects.