void CompleteDelete(bool goodMouseLoc, Vector3 mouseLoc) { bool actuallyDeleting = false; if (goodMouseLoc) { // we're on the ground, so figure out which tile we're on IntPoint2D tile = ConvertPointToTileIndex(mouseLoc); // and see if we have an object there GameObject delEndObj = scenarioInfo.GetBuilding(tile); if (delEndObj == curObject) { // if the two objects are the same if (scenarioInfo.IsHouse(tile)) { popMgr.RemoveHouse(tile); } actuallyDeleting = true; scenarioInfo.DeleteBuilding(tile); Destroy(delEndObj); } } if (!actuallyDeleting) { // fix the mat back curObject.GetComponent <MeshRenderer> ().material = savedMat; } curObject = null; }