Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Bug Unity 2019.3.0 Alpha 6 [MenuItem()] no longer works?

Discussion in '2019.3 Beta' started by ItsChristo, Jun 20, 2019.

  1. ItsChristo

    ItsChristo

    Joined:
    Nov 29, 2018
    Posts:
    3
    MenuItem is no longer working in alpha 6?
    [MenuItem("Tools/Foo/Bar %#b")]

    worked up until the latest version I was on (2019.3.0 Alpha 3).
    Anyone else having this issue?

    Code (CSharp):
    1. using UnityEditor;
    2. using UnityEngine;
    3.  
    4. public class FooBar : EditorWindow
    5. {
    6.     [MenuItem("Tools/Foo/Bar %#b")]
    7.     private static void Open()
    8.     {
    9.         // do a thing
    10.     }
    11. }
     
    Last edited: Jun 20, 2019
  2. JJJohan

    JJJohan

    Joined:
    Mar 18, 2016
    Posts:
    214
    The menu item attribute needs to be associated with a method directly after it, that's why it doesn't work above the floats :). Your menu entry would be calling the init method in the working version.
     
  3. ItsChristo

    ItsChristo

    Joined:
    Nov 29, 2018
    Posts:
    3
    Yes the tools are placed in the Editor folder and are written correctly o_O:confused:, otherwise they wouldn't have worked before. Please read the question and not hijack the post for an alternative question. Make a new thread. The issue is not with the written functionality. The issue is with this particular version of Unity with upgrading. When I downgrade to any version of Unity, all the tools work, other than in 2019.3 Alpha 6.

    So it's explicitly clear: I am referring to tooling made by not just myself. Tools made by others too also do not work. I have a hunch it's connected to another problem because when I make a fresh project and import tools, they work. But if they are in a older project (still 2019.3), that then gets upgraded, they do not work.

    I've already spoke to someone from Unity regarding this, so this thread can be closed now.
     
  4. ItsChristo

    ItsChristo

    Joined:
    Nov 29, 2018
    Posts:
    3
    1. I read what you said in your reply that was a question that could have been googled very quickly, or you could look on the Unity documentation to see how the MenuItem attribute works. You are not contributing to the solution, you simply hijacked the question to do with a potential bug to ask another question about implementation (making it completely off topic and a diluted thread).
    2. The problem is with Unity. I have spoken with someone from Unity, and have a work around fix for now. Please read what I write if you are going to reply to me, otherwise it is not a reply, it's a projection.
     
  5. Deleted User

    Deleted User

    Guest

    Sorry for the interference. I deleted my posts.