Hi, does anybody know if it is possible (and if yes then how) to add menu item to scene object context menu in hierarchy?

I can’t find the information nor figure it out.
I found the answer:
void Awake()
{
UnityEditor.SceneManagement.SceneHierarchyHooks.addItemsToSceneHeaderContextMenu += AddMenuItem;
}
private void AddMenuItem(GenericMenu menu, Scene scene)
{
menu.AddItem(EditorGUIUtility.TrTextContent("Test"), false, Test);
}
private void Test()
{
Debug.Log(this.GetHashCode());
}
2 Likes