UnityEngine.TerrainData.GetHeight C# (CSharp) Method

GetHeight() private method

private GetHeight ( int x, int y ) : float
x int
y int
return float
        public extern float GetHeight(int x, int y);
        /// <summary>

Usage Example

コード例 #1
0
	/**
	 * Compte le nombre de chaque éléments en texture sur le Terrain.
	 */
	public static void Ground(TerrainData tData, Texture[] textures){
		Init();

		for (int y = 0; y < tData.alphamapHeight; y++) {
			for (int x = 0; x < tData.alphamapWidth; x++) {
				if(tData.GetHeight(y,x) < textures[Texture.SAND].maxHeight){
					NB_SAND++;
				}else if(tData.GetHeight(y,x) > textures[Texture.GRASSHILL].minHeight && tData.GetHeight(y,x) < textures[Texture.GRASSHILL].maxHeight){
					NB_GRASSHILL++;
				}else if(tData.GetHeight(y,x) > textures[Texture.GRASSROCKY].minHeight && tData.GetHeight(y,x) < textures[Texture.GRASSROCKY].maxHeight){
					NB_GRASSROCKY++;
				}else if(tData.GetHeight(y,x) > textures[Texture.MUDROCKY].minHeight){
					NB_MUDROCKY++;
				}
			}
		}
	}
All Usage Examples Of UnityEngine.TerrainData::GetHeight