instead I patch the methods we are looking for with prefix/postfix modifying a static bool Called variable.
In such patches I return silently when thread is not simulation thread. this helps with thread safety.
NetToolCreateNode0Patch patches the called of NetToolCreateNodePatch and hence the 0 in the name. unlike NetToolCreateNodePatchNetToolCreate0NodePatch it is not called by "LoadPaths".
Notes:
there are multiple choices of where to assign segmentID and where to release segment skin. I could do it in prefix/postfixes I added or I could do it in Create/ReleaseSegment patches.
each call to MoveMiddleNode releases 1 segment and may create 1 segment ... no more.
each call to SplitSegment() releases no more than one segment (not including the ones by MoveMiddleNode).
bool Called
variable.NetToolCreateNode0Patch
patches the called ofNetToolCreateNodePatch
and hence the 0 in the name. unlikeNetToolCreateNodePatch
NetToolCreate0NodePatch
it is not called by "LoadPaths".Notes:
MoveMiddleNode
releases 1 segment and may create 1 segment ... no more.SplitSegment()
releases no more than one segment (not including the ones byMoveMiddleNode
).