jamesjlinden
2/24/2016 - 1:42 AM

Triggers a crash in some cases on iOS

Triggers a crash in some cases on iOS

using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.EventSystems;

// Attached to a large Image that blocks all input, OnPointerClick filters to a "target"
public class OnboardingArrowInputBlocker : MonoBehaviour, IPointerClickHandler
{
    public MonoBehaviour target;

    public void OnPointerClick(PointerEventData eventData)
    {
        if (target)
        {
            // Line that leads to the crash (crashes in Unity's internal code, not here):
            target.gameObject.SendMessage("OnPointerClick", eventData, SendMessageOptions.DontRequireReceiver);
        }
    }
}