Пример #1
0
 protected void SetClick(GameObject go, Action <GameObject> onClick = null)
 {
     if (onClick == null)
     {
         onClick = this.OnClick;
     }
     _clickListeners[go]             = onClick;
     UIClickListener.Get(go).onClick = this.Clicking;
 }
Пример #2
0
    public static UIClickListener Get(GameObject go)
    {
        if (go == null)
        {
            return(null);
        }
        UIClickListener listener = go.GetComponent <UIClickListener>();

        if (listener == null)
        {
            listener = go.AddComponent <UIClickListener>();
        }
        return(listener);
    }