Esempio n. 1
0
 /// <summary>
 /// The method is responsible for destroying the object
 /// </summary>
 /// <param name="spare">Junction that keep references to the street</param>
 public void Destroy(Junction spare = null)
 {
     if (from != spare)
     {
         from.RemoveJoint(this);
     }
     if (to != spare)
     {
         to.RemoveJoint(this);
     }
     Clear();
     DestroyImmediate(gameObject);
 }