Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Jofator on October 29, 2013, 04:29:05 AM

Title: Please add inspector OnClick event into Image Button
Post by: Jofator on October 29, 2013, 04:29:05 AM
Will you please add inspector OnClick event into Image Button as UIButton has?
It's very helpfull and you can do it by few lines of code:

Add into UIImageButtonInspector at the end of OnInspectorGUI:

      GUILayout.Space(3f);
      NGUIEditorTools.DrawEvents("On Click", mButton, mButton.onClick);   



And add into UIImageButton:

   using System.Collections.Generic;

   static public UIImageButton current;
   public List<EventDelegate> onClick = new List<EventDelegate>();
   
   void OnClick ()
   {
      if (isEnabled)
      {
         current = this;
         EventDelegate.Execute(onClick);
         current = null;
      }
   }
Title: Re: Please add inspector OnClick event into Image Button
Post by: ArenMook on October 29, 2013, 04:55:25 PM
I'm actually going to get rid of the image button script in a future update. Its functionality will be merged with UIButton.