- Home /
Question by
Bongmo · Feb 15, 2016 at 05:23 PM ·
uigameobjectcanvastoucheventsystem
Check UI panel touched after OnEnable()?
I have a canvas UI panel which is not visible. It's visible after 5 seconds, when the app starts.
On the mobile device I start the app. Then I touch hold on the screen where the panel should be visible.
Now I want to check this. When the panel is visible and my finger is on this UI panel it should print "OK". How can I solve this?
I've tried so many pointer event data examples without success.
void OnEnable()
{
PointerEventData eventDataCurrentPosition = new PointerEventData(EventSystem.current);
if (eventDataCurrentPosition.pointerEnter == gameObject) {
print ("OK.");
}
}
How can I solve this?
Comment
Your answer
Follow this Question
Related Questions
How to get PointerEventDatas[]? 0 Answers
Repositioning Items in ScrollRect During Scroll While Maintaining Offset 0 Answers
[c#] first script isnt disabling canvas and player cant move (issue with first script) 1 Answer
Eventsystem requires window focus? 0 Answers
UI Button onclick not detected 0 Answers