Ejemplo n.º 1
0
    private void SetObjectParent(GameObject tile)
    {
        switch (tile.layer)
        {
        case (int)Layers.Terrain:
            mapController.AddTerrainAsChild(tile);
            break;

        case (int)Layers.FarmLand:
            mapController.AddTerrainAsChild(tile);
            break;

        case (int)Layers.Building:
            buildingsController.AddBuildingAsChild(tile);
            break;

        case (int)Layers.WaterSource:
            buildingsController.AddBuildingAsChild(tile);
            break;

        case (int)Layers.Road:
            mapController.AddRoadAsChild(tile);
            roadsOnlyNavMesh.BuildNavMesh();
            break;
        }
    }