Example #1
0
 void OnDestroy()//clean up stuff
 {
     StartCorner.RemoveWall(this);
     EndCorner.RemoveWall(this);
     foreach (var p in placeables)
     {
         GameObject.Destroy(p.gameObject);
     }
     foreach (var p in cutouts)
     {
         GameObject.Destroy(p.gameObject);
     }
 }
Example #2
0
        public void SetEndCorner(CornerLogic corner)
        {
            if (corner == EndCorner)
            {
                return;
            }
            if (EndCorner != null)
            {
                EndCorner.RemoveWall(this);
            }
            EndCorner = corner;

            if (StartCorner != null && EndCorner != null)
            {
                Length = math.distance(GetStartPosition(), GetEndPosition());
            }

            corner.AddWall(this);
            if (StartCorner == null && EndCorner == null)
            {
                return;
            }
            UpdateLength();
        }