Fix collision assets creation in non asset folders.

This commit is contained in:
Chandler Cox
2023-04-24 17:47:19 -05:00
parent eb613d3e8a
commit c920b75142

View File

@@ -141,7 +141,13 @@ namespace FlaxEditor.Content
});
};
var initialName = (modelItem?.ShortName ?? Path.GetFileNameWithoutExtension(model.Path)) + " Collision";
Editor.Instance.Windows.ContentWin.NewItem(this, null, create, initialName, withRenaming);
// If folder can not have assets then move to folder with the model and create asset
var contentWin = Editor.Instance.Windows.ContentWin;
if (!contentWin.CurrentViewFolder.CanHaveAssets)
contentWin.Navigate(modelItem?.ParentFolder?.Node);
contentWin.NewItem(this, null, create, initialName, withRenaming);
}
}
}