void OnTriggerEnter2D(Collider2D col) { if (roomba.GetPathType() == PathType.WallFollow) { if (col.IsTouching(wallSensor) && col.gameObject.tag != "whiskers" && col.gameObject.tag != "vacuum") { roomba.GetPath().SetIsTouching(true); ++count; } } }
void Start() { roomba = GetComponentInParent <Roomba>(); path = roomba.GetPath(); }