using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class InteractableItemEditor : Editor
{
[MenuItem("InteractableItem/Make InteractableItem", false, 11)]
private static void InteractableItem()
{
foreach (GameObject o in Selection.gameObjects)
{
var g = o.GetComponent<InteractableItem>();
if (!g)
{
o.AddComponent<InteractableItem>();
o.tag = "Interactable Item";
}
}
}
}
The script is in the Editor folder under the Assets.
I tried to change from MenuItem to ContextMenu but still it's now showing the "InteractableItem/Make InteractableItem" when making right click with the mouse on gameobject in the heirarchy.