Пример #1
0
    public void StartPaint(Vector2 pos)
    {
        smoothBrush = new SmoothBrush(pos, brushSize, BRUSH_STEP, lastPaintableObject);

        if (lastPaintableObject.container != null)
        {
            lastPaintableObject.container.StartPaint();
        }
    }
Пример #2
0
    public void EndPaint()
    {
        smoothBrush.AddCP(brushPos, brushSize);
        smoothBrush.UpdateStroke();
        smoothBrush = null;

        if (lastPaintableObject.container != null)
        {
            lastPaintableObject.container.EndPaint();
        }

        RenderCanvas(lastPaintableObject, false);
        SaveTexture(lastPaintableObject);
    }
    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;
        }
    }