public void Clone(BuildingKnowledge buildingKnowledge) { path = buildingKnowledge.path; buildingIDPool = buildingKnowledge.buildingIDPool; buildings.Clear(); for (int i = 0; i < buildingKnowledge.buildings.Count; ++i) { BuildingType buildingType = new BuildingType(); buildingType.Clone(buildingKnowledge.buildings [i]); buildings.Add(buildingType); } }
void CloneBuildingType(BuildingType building) { if (buildingType == null) { buildingType = new BuildingType(); } buildingType.Clone(building); if (buildingType.tilePath.Length > 0) { buildingType.tileBase = AssetDatabase.LoadAssetAtPath <Tile> (buildingType.tilePath); } }