Current manager context.
The new layer wrapper to add.
The parent actor (if adding to a group).
Optionalindex: numberOptional index.
Optionalposition: "top" | "bottom"Optional position ('top' | 'bottom').
A partial context update (layers list and potentially order).
Calculates the new state for the Layer Manager after adding a layer.
NOTE: If
parentRefis provided, this function has a SIDE EFFECT of sending an event to that parent actor.