Ejemplo n.º 1
0
        public void UpdateRenderTextures()
        {
            if (!settings.terrain)
            {
                Debug.LogError("Terrain required");
                return;
            }

            m_rtCollection.ReleaseRTHandles();

            TerrainData terrainData = settings.terrain.terrainData;
            int         size        = terrainData.heightmapResolution;

            m_rtCollection.GatherRTHandles(size, size, 16);

            RenderTexture prevRt = RenderTexture.active;

            {
                RenderMesh();
            }
            RenderTexture.active = prevRt;

            if (debugView != null)
            {
                debugView.StoreDebugTextures();
            }

            m_rtCollection.ReleaseRTHandles();
        }