Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

UI Choosing OnClick function, reveals loads of inherited functions

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

  1. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    920
    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:
    531
    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:
    920
    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:
    531
    Ah, okay. Probably you can write a custom PropertyDrawer for Unity Events which fits your needs.