change terrain brush size with scroll

This commit is contained in:
Ruan Lucas
2023-10-10 10:46:47 -04:00
parent 00100e11f2
commit 7fcb0a1da7
4 changed files with 20 additions and 4 deletions

View File

@@ -150,6 +150,14 @@ namespace FlaxEditor.Tools.Terrain
return;
}
// Increase or decrease brush size with scroll
if (Input.GetKey(KeyboardKeys.Shift))
{
var currentBrush = Mode.CurrentBrush;
currentBrush.Size += dt * currentBrush.Size * Input.Mouse.ScrollDelta * 5f;
Mode.CurrentBrush = currentBrush;
}
// Check if no terrain is selected
var terrain = SelectedTerrain;
if (!terrain)

View File

@@ -139,9 +139,9 @@ namespace FlaxEditor.Tools.Terrain
}
/// <summary>
/// Gets the current brush.
/// Gets or set the current brush.
/// </summary>
public Brush CurrentBrush => _brushes[(int)_brushType];
public Brush CurrentBrush { get => _brushes[(int)_brushType]; set => _brushes[(int)_brushType] = value; }
/// <summary>
/// Gets the circle brush instance.

View File

@@ -158,6 +158,14 @@ namespace FlaxEditor.Tools.Terrain
return;
}
// Increase or decrease brush size with scroll
if (Input.GetKey(KeyboardKeys.Shift))
{
var currentBrush = Mode.CurrentBrush;
currentBrush.Size += dt * currentBrush.Size * Input.Mouse.ScrollDelta * 5f;
Mode.CurrentBrush = currentBrush;
}
// Check if selected terrain was changed during painting
if (terrain != _paintTerrain && IsPainting)
{

View File

@@ -158,9 +158,9 @@ namespace FlaxEditor.Tools.Terrain
}
/// <summary>
/// Gets the current brush.
/// Gets or set the current brush.
/// </summary>
public Brush CurrentBrush => _brushes[(int)_brushType];
public Brush CurrentBrush { get => _brushes[(int)_brushType]; set => _brushes[(int)_brushType] = value; }
/// <summary>
/// Gets the circle brush instance.