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:
@@ -26,8 +26,7 @@ namespace FlaxEditor.Content
|
||||
{
|
||||
if (reader.TokenType == JsonToken.String)
|
||||
{
|
||||
Guid id;
|
||||
FlaxEngine.Json.JsonSerializer.ParseID((string)reader.Value, out id);
|
||||
FlaxEngine.Json.JsonSerializer.ParseID((string)reader.Value, out Guid id);
|
||||
return Editor.Instance.ContentDatabase.Find(id);
|
||||
}
|
||||
|
||||
|
||||
@@ -113,8 +113,7 @@ namespace FlaxEditor.Content.Import
|
||||
extension = extension.ToLower();
|
||||
|
||||
// Check if use overriden type
|
||||
ImportFileEntryHandler createDelegate;
|
||||
if (FileTypes.TryGetValue(extension, out createDelegate))
|
||||
if (FileTypes.TryGetValue(extension, out ImportFileEntryHandler createDelegate))
|
||||
return createDelegate(ref request);
|
||||
|
||||
// Use default type
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace FlaxEditor.Content.Import
|
||||
var result = 0;
|
||||
for (int i = 0; i < _rootNode.ChildrenCount; i++)
|
||||
{
|
||||
if (_rootNode.Children[i].Tag is ImportFileEntry fileEntry)
|
||||
if (_rootNode.Children[i].Tag is ImportFileEntry)
|
||||
result++;
|
||||
}
|
||||
return result;
|
||||
@@ -215,8 +215,7 @@ namespace FlaxEditor.Content.Import
|
||||
var entries = new List<ImportFileEntry>(_rootNode.ChildrenCount);
|
||||
for (int i = 0; i < _rootNode.ChildrenCount; i++)
|
||||
{
|
||||
var fileEntry = _rootNode.Children[i].Tag as ImportFileEntry;
|
||||
if (fileEntry != null)
|
||||
if (_rootNode.Children[i].Tag is ImportFileEntry fileEntry)
|
||||
entries.Add(fileEntry);
|
||||
}
|
||||
Editor.Instance.ContentImporting.LetThemBeImportedxD(entries);
|
||||
|
||||
@@ -599,7 +599,7 @@ namespace FlaxEditor.Content
|
||||
public override bool OnShowTooltip(out string text, out Vector2 location, out Rectangle area)
|
||||
{
|
||||
UpdateTooltipText();
|
||||
var result = base.OnShowTooltip(out text, out location, out area);
|
||||
var result = base.OnShowTooltip(out text, out _, out area);
|
||||
location = Size * new Vector2(0.9f, 0.5f);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -74,12 +74,13 @@ namespace FlaxEditor.Content
|
||||
/// <inheritdoc />
|
||||
public override void Create(string outputPath, object arg)
|
||||
{
|
||||
var actor = arg as Actor;
|
||||
if (actor == null)
|
||||
if (!(arg is Actor actor))
|
||||
{
|
||||
// Create default prefab root object
|
||||
actor = new EmptyActor();
|
||||
actor.Name = "Root";
|
||||
actor = new EmptyActor
|
||||
{
|
||||
Name = "Root"
|
||||
};
|
||||
|
||||
// Cleanup it after usage
|
||||
Object.Destroy(actor, 20.0f);
|
||||
|
||||
@@ -120,9 +120,8 @@ namespace FlaxEditor.Content
|
||||
}
|
||||
else
|
||||
{
|
||||
QueryFilterHelper.Range[] ranges;
|
||||
var text = Text;
|
||||
if (QueryFilterHelper.Match(filterText, text, out ranges))
|
||||
if (QueryFilterHelper.Match(filterText, text, out QueryFilterHelper.Range[] ranges))
|
||||
{
|
||||
// Update highlights
|
||||
if (_highlights == null)
|
||||
|
||||
Reference in New Issue
Block a user