diff --git a/Source/Editor/Content/Items/ContentItem.cs b/Source/Editor/Content/Items/ContentItem.cs index 9813cd44e..8f97a9330 100644 --- a/Source/Editor/Content/Items/ContentItem.cs +++ b/Source/Editor/Content/Items/ContentItem.cs @@ -505,6 +505,14 @@ namespace FlaxEditor.Content } } + /// + /// Called when context menu is being prepared to show. Can be used to add custom options. + /// + /// The menu. + public virtual void OnContextMenu(FlaxEditor.GUI.ContextMenu.ContextMenu menu) + { + } + /// /// Called when item gets renamed or location gets changed (path modification). /// diff --git a/Source/Editor/Windows/ContentWindow.ContextMenu.cs b/Source/Editor/Windows/ContentWindow.ContextMenu.cs index cded93cc0..541517254 100644 --- a/Source/Editor/Windows/ContentWindow.ContextMenu.cs +++ b/Source/Editor/Windows/ContentWindow.ContextMenu.cs @@ -123,6 +123,7 @@ namespace FlaxEditor.Windows // Custom options ContextMenuShow?.Invoke(cm, item); proxy?.OnContentWindowContextMenu(cm, item); + item.OnContextMenu(cm); cm.AddButton("Copy name to Clipboard", () => Clipboard.Text = item.NamePath);