Beispiel #1
0
 private void update_direction_of_connections(Subfigure subfigure)
 {
     foreach (Subfigure next_subfigure in subfigure.next.ToArray())
     {
         if (
             subfigure.transform.position.x >
             next_subfigure.transform.position.x
             )
         {
             subfigure.disconnect_from_next(next_subfigure);
             next_subfigure.connext_to_next(subfigure);
             Debug.Log("next_subfigure changes to prev");
         }
     }
     foreach (Subfigure prev_subfigure in subfigure.previous.ToArray())
     {
         if (
             subfigure.transform.position.x <
             prev_subfigure.transform.position.x
             )
         {
             prev_subfigure.disconnect_from_next(subfigure);
             subfigure.connext_to_next(prev_subfigure);
             Debug.Log("prev_subfigure changes to next");
         }
     }
 }
 private void delete_all_connections_touching(Subfigure detached_subfigure)
 {
     foreach (Subfigure subfigure in subfigures)
     {
         if (detached_subfigure.next.Contains(subfigure))
         {
             detached_subfigure.disconnect_from_next(subfigure);
         }
         if (subfigure.next.Contains(detached_subfigure))
         {
             subfigure.disconnect_from_next(detached_subfigure);
         }
     }
 }