Merge remote-tracking branch 'origin/master' into linux-editor

# Conflicts:
#	Source/Engine/Core/Math/Color.cs
#	Source/Engine/Navigation/Navigation.cpp
#	Source/Engine/Platform/Win32/Win32Platform.cpp
This commit is contained in:
Wojtek Figat
2021-02-23 22:29:07 +01:00
147 changed files with 1740 additions and 1311 deletions

View File

@@ -56,8 +56,10 @@ namespace FlaxEditor.Tools.Foliage
if (!_staticModel)
{
_staticModel = new StaticModel();
_staticModel.StaticFlags = StaticFlags.None;
_staticModel = new StaticModel
{
StaticFlags = StaticFlags.None
};
}
_staticModel.Model = model;

View File

@@ -179,9 +179,11 @@ namespace FlaxEditor.Tools.Foliage
private void OnCreateNewFoliageClicked()
{
// Create
var actor = new FlaxEngine.Foliage();
actor.StaticFlags = StaticFlags.FullyStatic;
actor.Name = "Foliage";
var actor = new FlaxEngine.Foliage
{
StaticFlags = StaticFlags.FullyStatic,
Name = "Foliage"
};
// Spawn and select
Editor.SceneEditing.Spawn(actor);

View File

@@ -282,8 +282,7 @@ namespace FlaxEditor.Tools.Foliage
};
// Try restore painting with the given model ID
bool itemChecked;
if (!Tab.FoliageTypeModelIdsToPaint.TryGetValue(model.ID, out itemChecked))
if (!Tab.FoliageTypeModelIdsToPaint.TryGetValue(model.ID, out bool itemChecked))
{
// Enable by default
itemChecked = true;

View File

@@ -179,8 +179,10 @@ namespace FlaxEditor.Tools.Terrain
// Start async work
_terrain = terrain;
var thread = new System.Threading.Thread(Generate);
thread.Name = "Terrain Generator";
var thread = new System.Threading.Thread(Generate)
{
Name = "Terrain Generator"
};
thread.Start();
}

View File

@@ -310,10 +310,9 @@ namespace FlaxEditor.Tools.Terrain
throw new InvalidOperationException("Cannot set cursor then no terrain is selected.");
var brushBounds = CursorBrushBounds;
var patchesCount = terrain.PatchesCount;
BoundingBox tmp;
for (int patchIndex = 0; patchIndex < patchesCount; patchIndex++)
{
terrain.GetPatchBounds(patchIndex, out tmp);
terrain.GetPatchBounds(patchIndex, out BoundingBox tmp);
if (!tmp.Intersects(ref brushBounds))
continue;

View File

@@ -329,10 +329,9 @@ namespace FlaxEditor.Tools.Terrain
throw new InvalidOperationException("Cannot set cursor then no terrain is selected.");
var brushBounds = CursorBrushBounds;
var patchesCount = terrain.PatchesCount;
BoundingBox tmp;
for (int patchIndex = 0; patchIndex < patchesCount; patchIndex++)
{
terrain.GetPatchBounds(patchIndex, out tmp);
terrain.GetPatchBounds(patchIndex, out BoundingBox tmp);
if (!tmp.Intersects(ref brushBounds))
continue;