Beispiel #1
0
        private void DeformTerrain(BrushOperation operation)
        {
            var brush = new SphereBrush {
                origin = hitPoint,
                radius = radius,
            };

            terrain.DeformTerrain(brush, operation);
        }
    private void UseTool(MarchingTerrain terrain)
    {
        if (!IsReady())
        {
            return;
        }

        switch (m_terrainEditorUtility.currentProps.currentToolType)
        {
        case ToolType.CircleBrush: CircleBrush.Execute(terrain, m_terrainEditorUtility.currentProps, m_hotkeyUtility.IsInvertedMode()); break;

        case ToolType.SphereBrush: SphereBrush.Execute(terrain, m_terrainEditorUtility.currentProps, m_hotkeyUtility.IsInvertedMode()); break;

        case ToolType.Smooth: SmoothBrush.Execute(terrain, m_terrainEditorUtility.currentProps, m_hotkeyUtility.IsInvertedMode()); break;

        case ToolType.Noise: NoiseBrush.Execute(terrain, m_terrainEditorUtility.currentProps, m_hotkeyUtility.IsInvertedMode()); break;

        case ToolType.Paint: PaintBrush.Execute(terrain, m_terrainEditorUtility.currentProps, m_hotkeyUtility.IsInvertedMode()); break;
        }
    }