Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


CreateFromConnectedNeighbors(Terrain, Predicate<Terrain>, bool)

Creates a TerrainMap from the neighbors connected to the origin Terrain.
Read time 1 minuteLast updated 12 days ago

Definition

public static TerrainMap CreateFromConnectedNeighbors(Terrain originTerrain, Predicate<Terrain> filter = null, bool fullValidation = true)

Parameters

originTerrain

Terrain that is given tile coordinate (0,0).

Filter to apply when populating the map. If null, no filter is applied.

fullValidation

Validate the Terrain map. Default is true.

Returns

Type

Description

TerrainMapThe resulting Terrain map. Can return null when no Terrain objects pass the filter.

Remarks

Creates a TerrainMap of all the Terrain neighbors connected to the origin Terrain that pass the filter validation.