unsafe void SetPart(Part p, int index, VoxelOrientationPlane plane, byte location) { PartSizePair pair = voxelPoints[index]; Part currentPart = pair.part; //if we update the plane location with this, then we can consider replacing the part here. Otherwise, we don't bool largerThanLast = pair.SetPlaneLocation(plane, location); if ((object)currentPart == null || overridingParts.Contains(p) || (largerThanLast && !overridingParts.Contains(currentPart))) { pair.part = p; } }
private void SetPart(Part p, int index, VoxelOrientationPlane plane, byte location) { PartSizePair pair = voxelPoints[index]; Part currentPart = pair.part; //if we update the plane location with this, then we can consider replacing the part here. Otherwise, we don't bool largerThanLast = pair.SetPlaneLocation(plane, location); int currentPriority = PartPriority(currentPart); int newPriority = PartPriority(p); if (newPriority > currentPriority || largerThanLast && currentPriority <= 0) { pair.part = p; } }