コード例 #1
0
    private void Update()
    {
        float segmentLength = length / lengthSegments;
        bool  overflow      = AddRow();

        if (!overflow)
        {
            transform.position = transform.position + transform.forward * -segmentLength;
        }
        else
        {
            DisplaceVerticesInZ();
        }
        float[]   rowheights = athm.GetRowHeightMap(_currentwidthSegments);
        Color32[] colors     = terrainColor.GetHeightColors(rowheights);
        UpdateLastRowMeshVertices(rowheights, colors);
        eventTerrainMoved?.Invoke(segmentLength);
    }