Beispiel #1
0
        IEnumerator Sequence()
        {
            foreach (var track in _currentRecord.Tracks)
            {
                yield return(new WaitForSeconds(track.WaitSec));

                GameObject target = GameObject.Find(track.Path);
                while (target == null)
                {
                    yield return(new WaitForSeconds(0.5f));

                    target = GameObject.Find(track.Path);
                }

                var clickHandler = target.GetComponent <IPointerClickHandler>();
                if (clickHandler != null)
                {
                    ExecuteEvents.pointerClickHandler(clickHandler, new PointerEventData(EventSystem.current));
                    continue;
                }

                var downHanlder = target.GetComponent <IPointerDownHandler>();
                if (downHanlder != null)
                {
                    ExecuteEvents.pointerDownHandler(downHanlder, new PointerEventData(EventSystem.current));
                    continue;
                }
            }
        }