示例#1
0
 private void DecombinePreview(bool _isStart)
 {
     if (_isStart && m_previewStreet.GetStartConnection().m_OtherConnection != null)
     {
         Connection oldConnection = m_previewStreet.GetStartConnection().m_OtherConnection;
         Connection.DeCombine(m_previewStreet.GetStartConnection(), m_previewStreet.GetStartConnection().m_OtherConnection);
         if (oldConnection.m_Owner is Street)
         {
             StreetComponentManager.CreateDeadEnd((Street)oldConnection.m_Owner, oldConnection.m_OwnerStart);
         }
         else if (oldConnection.m_Owner is Cross)
         {
             Cross c = (Cross)oldConnection.m_Owner;
             StreetComponentManager.CreateDeadEnd((Cross)oldConnection.m_Owner, c.GetIndexByConnection(oldConnection));
         }
     }
     else if (m_previewStreet.m_EndConnection.m_OtherConnection != null)
     {
         Connection oldConnection = m_previewStreet.m_EndConnection.m_OtherConnection;
         Connection.DeCombine(m_previewStreet.m_EndConnection, m_previewStreet.m_EndConnection.m_OtherConnection);
         if (oldConnection.m_Owner is Street)
         {
             StreetComponentManager.CreateDeadEnd((Street)oldConnection.m_Owner, oldConnection.m_OwnerStart);
         }
         else if (oldConnection.m_Owner is Cross)
         {
             Cross c = (Cross)oldConnection.m_Owner;
             StreetComponentManager.CreateDeadEnd((Cross)oldConnection.m_Owner, c.GetIndexByConnection(oldConnection));
         }
     }
 }
示例#2
0
        private void RemoveStartConnection()
        {
            Connection otherConnection = m_cross.GetStartConnection().m_OtherConnection;

            if (otherConnection == null)
            {
                return;
            }
            Connection.DeCombine(m_cross.GetStartConnection(), otherConnection);
            StreetComponentManager.CreateDeadEnd((Street)otherConnection.m_Owner, otherConnection.m_OwnerStart);
        }