26 {
27 BoxCollider coll = GetComponent<BoxCollider>();
28 int layer = LayerMask.NameToLayer("PG_Wall");
29
30 if (coll != null)
31 {
32 Collider[] colliders = Physics.OverlapBox(coll.bounds.center, coll.bounds.extents, Quaternion.identity, 1 << layer);
33
34 for (int i = 0; i < colliders.Length; i++)
35 {
36 if (colliders[i] != coll)
37 {
38 myContacts.Add(colliders[i]);
39 }
40 }
41
42 if (myContacts.Count > 6)
43 {
44 iAmBoundaryWall = false;
45 }
46 else
47 {
48 iAmBoundaryWall = true;
49 }
50
51 for (int i = 0; i < myContacts.Count; i++)
52 {
53 if (myContacts[i] != null && myContacts[i].transform == transform)
54 {
55 Wall theirWall = myContacts[i].GetComponent<Wall>();
56 if (theirWall != null)
57 {
58 siblingWall = theirWall;
59 }
60 }
61 }
62
63 }
64 return iAmBoundaryWall;
65 }