public override void Refresh() { foreach (var projectRecord in new List <CityProjectRecord>(InstantiatedProjectRecords)) { Destroy(projectRecord.gameObject); } InstantiatedProjectRecords.Clear(); if (ObjectToDisplay == null) { return; } var cityOwner = CityPossessionCanon.GetOwnerOfPossession(ObjectToDisplay); if (DisplayType == CityDisplayType.PlayMode) { AddUnitProjects(cityOwner); AddBuildingProjects( cityOwner, TechCanon.GetResearchedBuildings(cityOwner), template => ObjectToDisplay.ActiveProject = ProjectFactory.ConstructProject(template) ); } else if (DisplayType == CityDisplayType.MapEditor) { AddBuildingProjects( cityOwner, AllBuildingTemplates, template => BuildingFactory.BuildBuilding(template, ObjectToDisplay) ); } }