public BuildingType GetBuildingType() { if (connectedObject == null) { return(BuildingType.NULL); } BuildingController bc = connectedObject.GetComponent <BuildingController>(); if (bc != null) { return(bc.GetBuilingType()); } return(BuildingType.NULL); }