clean code

This commit is contained in:
Ruan Lucas
2023-10-11 18:37:04 -04:00
parent 7fcb0a1da7
commit e97ec74bf8
4 changed files with 6 additions and 10 deletions

View File

@@ -153,9 +153,7 @@ namespace FlaxEditor.Tools.Terrain
// 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;
Mode.CurrentBrush.Size += dt * Mode.CurrentBrush.Size * Input.Mouse.ScrollDelta * 5f;
}
// Check if no terrain is selected

View File

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

View File

@@ -161,9 +161,7 @@ namespace FlaxEditor.Tools.Terrain
// 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;
Mode.CurrentBrush.Size += dt * Mode.CurrentBrush.Size * Input.Mouse.ScrollDelta * 5f;
}
// Check if selected terrain was changed during painting

View File

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