Search Unity

Event Trigger: Pass UI Component as parameter

Discussion in 'UGUI & TextMesh Pro' started by CaptainChristian, Oct 8, 2014.

  1. CaptainChristian

    CaptainChristian

    Joined:
    Apr 3, 2013
    Posts:
    100
    How do you pass a ui component to a function? I added a simple method which takes a text component and a bool and for some reason this method is not listed in the function list of that script. Without the component it shows up, other custom components do show up.

    This should be really handy for tooltips and similar behaviours.
     
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    We only allow single argument functions for preconfigured function callbacks in UnityEvent
     
  3. CaptainChristian

    CaptainChristian

    Joined:
    Apr 3, 2013
    Posts:
    100
    Alright, thanks.