Search Unity

UI Choosing OnClick function, reveals loads of inherited functions

Discussion in 'UGUI & TextMesh Pro' started by andyz, Dec 4, 2018.

  1. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,269
    Choosing an OnClick function [edit - in inspector] is a little clunky - you could save a + button click by allowing drag and drop of a gameObject to add a new call, like NGUI does but anyway - when you go to choose a function/property on a monobehaviour to call, it actually shows you 12 inherited monobehaviour calls like 'enable', 'name', 'CancelInvoke' etc. so even if you have 1 public function it is hidden among all those.
    Can I suggest the base monobehaviour calls are togglable, placed last, faded or otherwise separated from the more likely calls you want to select which you have added? Perhaps fiddly to make happen though...
     
    Last edited: Dec 5, 2018
  2. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,096
    I am not sure if I understand you correctly because you are talking about a lot of different unrelated stuff...

    Don't know what you are complaining about. If you want drag'n'drop functionality, add an EventTrigger component to your object.

    Your IDE shows you what you can access of the object. That is actually a cool thing about intelliSense...

    Yes, I sometimes also wish I could filter the list a bit better. I use Visual Studio. There it is not possible out of the box. In MonoDevelop also not AFAIK. Not sure about Rider or other IDEs.
    Anyways, maybe there is a plugin for your IDE. But this has nothing to do with UGUI or Unity.
     
  3. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,269
    Perhaps I was not clear - I meant when choosing an On Click () function in the inspector UI, not code.

    Although list is big in IDE too - true
     
  4. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,096
    Ah, okay. Probably you can write a custom PropertyDrawer for Unity Events which fits your needs.