Anthony thank you. We just received the update. We also improved some parts of the script maybe you want to use it.
First of you should use assembly definitions. In our project your asset didn't work. We had to add assembly definitions for you assets.
Second.
You use GetComponent<Button>() in TutorialController.cs to register on onClick event. But this is not compatible with custom buttons like from DoozyUI System (UIButton) or if someone implement own OnPointerClick.
Its better you try to find IPointerClickHandler. This allows also to use on non button components like from EventTrigger or people who use own OnPointerClick logic (like Doozy UI). Also others like toggle works 🙂
Button btn = currentTarget.GetComponent<Button>(); // <<< This is not needed anymore
hiddenBtn.onClick.RemoveAllListeners();
var pointerClickHandler = currentTarget.GetComponent<IPointerClickHandler>();
bool isClickable = false; // instead checking btn is null we use this.
if (s.isClickable && rt != null)
{
if (pointerClickHandler != null)
{
hiddenBtn.gameObject.SetActive(true);
hiddenBtn.onClick.AddListener(() =>
ExecuteEvents.Execute(currentTarget, new PointerEventData(EventSystem.current), ExecuteEvents.pointerClickHandler));
isClickable = true;
}
}
else
{
hiddenBtn.gameObject.SetActive(false);
}
if (s.isReplacingNextButton && rt != null && isClickable )
{
popup.nextBtn.gameObject.SetActive(false);
hiddenBtn.onClick.AddListener(popup.nextBtn.onClick.Invoke);
}
else
{
popup.nextBtn.gameObject.SetActive(true);
}
As you can see we get ponterClickHandler. If found we know the element can register a "click". The ExecuteEvents.Execute comes from UnityEngine.UI and this will execute the "click". Like I said also Toggles or any clickable element should work (they need at least IPointerClickHandler Interface.
But careful. For Submit you would need ISubmitHandler as well ( mostly used by gamepads ). We also will implement this. Gamepads weren't tested with this code.