- Home /
Unity 2017.1.0p5: Editor: Cannot add menu item 'GameObject/UI/Text' for method 'MenuOptions.AddText' because a menu item with the same name already exists.
I updated to 2017.1.0p5 from a 5.5.0f1 old versión.
Everything went better than expected.
But, I get this Warning:
I was overriding the GameObject MenuItem to add a Text, to add my own Text (for translations). And since the update, the override doesnt seems to work.
Does anyone know why?
Code:
[MenuItem("GameObject/UI/Text")]
public static void AddText(MenuCommand command)
{
//I DO THINGS HERE
}
Answer by tormentoarmagedoom · Sep 15, 2017 at 10:50 AM
Hello @Mese !
As message says, there is another item with the same name, try to give it another name.
The thing is... I did have another item with the same name on 5.5.0f1 and no warning was thrown and worked flawlessly.
Yea, Unity 2017 and Visual Studio 217 have a lot of new Alert messages, like thisone. They are alerts, not errors, but they can make errors if contiunue scripting using this name.
Please upvote and mark the answer! :D
Bye :D
Your answer
Follow this Question
Related Questions
Repaint EditorSettings inspector from custom menu item 1 Answer
How do I add a MenuItem to Hierarchy's Create Menu? 2 Answers
MenuItem toggle getting reset on play. 0 Answers
Editor Scripting Question 1 Answer
Can I create MenuItem from code? 3 Answers