public override void Add(Vector3Int incoming, ChunkStageData stageData) { if (!TerminateHereCondition(stageData)) { //Add the incoming chunk if it isn't terminating here if (!neighbourStatuses.ContainsKey(incoming)) { //Add if not already present var incomingStatus = ComputeStatus(incoming); neighbourStatuses.Add(incoming, incomingStatus); CheckIfWaitOver(incoming, incomingStatus); } } if (stageData.minStage > prevStageId) { ///If the minimum stage of the incoming chunk is greater than the previous stage, ///update the statuses of the neighbours. ///Otherwise, there is another instance of the incoming chunk ID earlier in the pipeline ///that must be waited for instead. UpdateStatusOfNeighbours(incoming, true); } }
public override void Add(Vector3Int incoming, ChunkStageData stageData) { base.Add(incoming, stageData); func(incoming);//Apply the function to anything entering this stage, even if it terminates here. }