Ejemplo n.º 1
0
        public void OnSave()
        {
            terrain     = GetComponent <Terrain>();
            terrainData = terrain.terrainData;
            int sectorSize = terrainData.heightmapResolution - 1;

            boundSector = new FBoundSector(0, sectorSize, 0, transform.position, terrainData.bounds, false);
        }
Ejemplo n.º 2
0
        public void OnSave()
        {
            if (m_LastNumSection == numSection)
            {
                return;
            }
            m_LastNumSection = numSection;

            terrain     = GetComponent <Terrain>();
            terrainData = GetComponent <TerrainCollider>().terrainData;

            TerrainTexture HeightTexture = new TerrainTexture(sectorSize);

            HeightTexture.TerrainDataToHeightmap(terrainData);

            boundSector = new FBoundSector(numSection, sectorSize, sectionSize, transform.position, terrainData.bounds);
            boundSector.BuildBounds(sectorSize, sectionSize, terrainScaleY, transform.position, HeightTexture.HeightMap);

            HeightTexture.Release();
        }