private void OnUndoRedo()
    {
        // Ensure selection doesn't create error
        ClearContourSelection();
        ClearPointSelection();
        // Update target
        SetTarget();
        SetTargetDirty();
        // Update ContourBuilder
        ContourBlocBuilder targetBuilder = targetBloc.GetComponent <ContourBlocBuilder>();

        if (targetBuilder != null)
        {
            targetBuilder.RebuildAll();
        }
    }
 private void SetTarget()
 {
     // When switching target
     if (target != targetBloc || targetBloc == null)
     {
         targetBloc = target as ContourBloc;
         ContourBlocBuilder attachedBuilder = targetBloc.GetComponent <ContourBlocBuilder>();
         createContourMode = false;
         CorrectPointSelectionArrayLengths();
         CorrectContourSelectionArrayLengths();
     }
 }