private bool AllocateHouse(GameObject house) { HouseScript houseScript = house.GetComponent("HouseScript") as HouseScript; if (houseScript.AllocateAgent()) { agentBehaviours.SetHome(house); return(true); } return(false); }