public void AddObjectToLayer(MapIndex mapIndex) { MapObject mo = mapController.MapObjectDataCollection.GetMapObjectById(MapUtility.CoordinateToId(mapIndex.x, mapIndex.z, mapController.MapSizeX)); if (mo != null) { int objCount = mo.ObjectDataList.Count; if (objCount > 0) { mapLayers.AddObjectToLayer(selectLayers, mo.ObjectDataList[objCount - 1]); } } }