Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Signal dropdown submenu organization

Discussion in 'Timeline' started by urrmurrmur, Jan 12, 2024.

  1. urrmurrmur

    urrmurrmur

    Joined:
    Sep 2, 2013
    Posts:
    32
    Hi,

    Quick question about signals: is it possible to organize them into subgroups that are used as submenus in the inspector dropdown? I'm working on a project that makes heavy use of timelines and signals, and I've got so many signals now that the default dropdown is becoming very unwieldy to use.
     
  2. julienb

    julienb

    Unity Technologies

    Joined:
    Sep 9, 2016
    Posts:
    177
    You can use the DisplayName attribute and '/' to create a submenu:

    Code (CSharp):
    1. using System.ComponentModel;
    2. using UnityEngine.Timeline;
    3.  
    4. [DisplayName("SubMenu1/SubMenu 2/Custom marker")]
    5. public class CustomMarker : Marker { }
    upload_2024-1-12_14-23-56.png
     
  3. urrmurrmur

    urrmurrmur

    Joined:
    Sep 2, 2013
    Posts:
    32
    Thanks. That's for custom markers though, I'm referring to default signals - specifically the inspector menu dropdown where we assign callbacks to each signal on the timeline. Image as an example, I have many more signals than are shown here, so it becomes very unwieldy to use.

    upload_2024-1-13_12-59-0.png
     
  4. julienb

    julienb

    Unity Technologies

    Joined:
    Sep 9, 2016
    Posts:
    177
    Oh I see... Unfortunately, there is no way to add a submenus/subgroups. I looked at the code and only the name of the signal asset is used to build the menu. I'll add a feature request.
     
  5. urrmurrmur

    urrmurrmur

    Joined:
    Sep 2, 2013
    Posts:
    32
    Thanks. Something as simple as using underscores (or whichever predefined symbol) to split the name of a signal into nested submenus would solve the issue entirely. And it has the added benefit of not requiring any additional information to build the menu, just use the names in a slightly different way. There's potential backwards compatibility issues, of course.