Welcome,
Guest
. Please
login
or
register
.
October 03, 2024, 09:32:55 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Touches and Event System
« previous
next »
Print
Pages: [
1
]
Author
Topic: Touches and Event System (Read 1817 times)
Zophiel
Jr. Member
Thank You
-Given: 0
-Receive: 0
Posts: 54
Touches and Event System
«
on:
December 05, 2012, 05:36:17 PM »
Hello,
I've been reading several threads on the NGUI event system but i'm unsure how to set it up correctly with multi touches. If i got this right i need to at least attached an instance of UICamera to my main game camera. But how do i convert the following code to correctly use the NGUi events?
//Touch and drag
if
(
Input
.
touchCount
==
1
&&
Input
.
GetTouch
(
0
)
.
phase
==
TouchPhase
.
Moved
)
//Pinch to zoom
if
(
Input
.
touchCount
>
1
&&
(
Input
.
GetTouch
(
0
)
.
phase
==
TouchPhase
.
Moved
||
Input
.
GetTouch
(
1
)
.
phase
==
TouchPhase
.
Moved
)
)
Reason being that when i press a button in my scene the camera reacts to it.
Cheers
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Touches and Event System
«
Reply #1 on:
December 05, 2012, 06:21:49 PM »
You don't. You create functions -- OnPress, OnDrag, etc -- and write your logic inside. You can check what touch it is via UICamera.currentTouchID.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Touches and Event System