public static void OnRightClick(this Button button, OnClickDelegate callback) { TooltipTrigger trig = button.gameObject.GetComponent <TooltipTrigger>(); if (trig == null) { trig = button.gameObject.AddComponent <TooltipTrigger>(); } trig.AddRightClick(callback); }
public static void RemoveAllEvents(this Button button) { TooltipTrigger trig = button.gameObject.GetComponent <TooltipTrigger>(); if (trig == null) { return; } trig.removeAllEvents(); }
public static void AddHover(this Button button, OnHoverDelegate callback, bool redrawOnUpdate) { TooltipTrigger trig = button.gameObject.GetComponent <TooltipTrigger>(); if (trig == null) { trig = button.gameObject.AddComponent <TooltipTrigger>(); } trig.AddHover(callback, redrawOnUpdate); }
public static void AddHover(this Toggle button, OnHoverDelegate callback, bool redrawOnUpdate) { TooltipTrigger trig = button.gameObject.GetComponent <TooltipTrigger>(); if (trig == null) { trig = button.gameObject.AddComponent <TooltipTrigger>(); } trig.AddHover(callback, redrawOnUpdate); //EventTrigger trig = button.gameObject.GetComponent<EventTrigger>(); //trig.OnPointerEnter. }