public void Attach(SnakePart part) { if (tail) { tail.Attach(part); } else { part.transform.position = transform.position; tail = part; tail.index = index + 1; tail.gameObject.name = "Tail " + tail.index; mid.parent = transform.parent; part.moveDirection = moveDirection; } }