Merge remote-tracking branch 'origin/master' into 1.9

# Conflicts:
#	Source/Engine/Audio/Audio.cpp
This commit is contained in:
Wojtek Figat
2024-07-05 22:18:40 +02:00
122 changed files with 8832 additions and 4272 deletions

View File

@@ -160,16 +160,23 @@ namespace FlaxEditor.Windows.Assets
var result = base.OnDragDrop(ref location, data);
if (result == DragDropEffect.None)
{
_window._isDropping = true;
// Drag assets
if (_dragAssets != null && _dragAssets.HasValidDrag)
{
List<SceneGraphNode> graphNodes = new List<SceneGraphNode>();
for (int i = 0; i < _dragAssets.Objects.Count; i++)
{
var item = _dragAssets.Objects[i];
var actor = item.OnEditorDrop(this);
actor.Name = item.ShortName;
_window.Spawn(actor);
var graphNode = _window.Graph.Root.Find(actor);;
if (graphNode != null)
graphNodes.Add(graphNode);
}
if (graphNodes.Count > 0)
_window.Select(graphNodes);
result = DragDropEffect.Move;
}
// Drag actor type
@@ -213,6 +220,7 @@ namespace FlaxEditor.Windows.Assets
// Drag script item
else if (_dragScriptItems != null && _dragScriptItems.HasValidDrag)
{
List<SceneGraphNode> graphNodes = new List<SceneGraphNode>();
for (int i = 0; i < _dragScriptItems.Objects.Count; i++)
{
var item = _dragScriptItems.Objects[i];
@@ -227,8 +235,13 @@ namespace FlaxEditor.Windows.Assets
}
actor.Name = actorType.Name;
_window.Spawn(actor);
var graphNode = _window.Graph.Root.Find(actor);;
if (graphNode != null)
graphNodes.Add(graphNode);
}
}
if (graphNodes.Count > 0)
_window.Select(graphNodes);
result = DragDropEffect.Move;
}
_dragHandlers.OnDragDrop(null);

View File

@@ -42,6 +42,7 @@ namespace FlaxEditor.Windows.Assets
private bool _liveReload = false;
private bool _isUpdatingSelection, _isScriptsReloading;
private DateTime _modifiedTime = DateTime.MinValue;
private bool _isDropping = false;
/// <summary>
/// Gets the prefab hierarchy tree control.
@@ -273,11 +274,16 @@ namespace FlaxEditor.Windows.Assets
return true;
}
if (button == MouseButton.Left && _treePanel.ContainsPoint(ref location))
if (button == MouseButton.Left && _treePanel.ContainsPoint(ref location) && !_isDropping)
{
_tree.Deselect();
return true;
}
if (_isDropping)
{
_isDropping = false;
return true;
}
return false;
}