Example #1
0
 //---------------------------------------------------------
 public static void RegisterButtonDelegate(GUIBase_Button button,
                                           GUIBase_Button.TouchDelegate2 touch,
                                           GUIBase_Button.ReleaseDelegate2 release,
                                           GUIBase_Button.CancelDelegate2 cancel)
 {
     if (button != null)
     {
         button.RegisterTouchDelegate2(touch);
         button.RegisterReleaseDelegate2(release);
         button.RegisterCancelDelegate2(cancel);
     }
     else
     {
         Debug.LogError("Invalid agrument - button (null) ");
     }
 }
Example #2
0
    //---------------------------------------------------------
    public static GUIBase_Button RegisterButtonDelegate(GUIBase_Layout layout,
                                                        string buttonName,
                                                        GUIBase_Button.TouchDelegate2 touch,
                                                        GUIBase_Button.ReleaseDelegate2 release,
                                                        GUIBase_Button.CancelDelegate2 cancel)
    {
        GUIBase_Button control = GetControl <GUIBase_Button>(layout, buttonName);

        if (control != null)
        {
            RegisterButtonDelegate(control, touch, release, cancel);
        }
        else
        {
            Debug.LogError("Can't find button '" + buttonName);
        }
        return(control);
    }