Welcome,
Guest
. Please
login
or
register
.
April 25, 2026, 05:50:27 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Bug with UICamera.ProcessTouch
« previous
next »
Print
Pages: [
1
]
Author
Topic: Bug with UICamera.ProcessTouch (Read 4530 times)
romeo_ftv
Newbie
Thank You
-Given: 0
-Receive: 1
Posts: 4
Bug with UICamera.ProcessTouch
«
on:
March 11, 2014, 01:53:42 PM »
public
void
ProcessTouch
(
bool
pressed,
bool
unpressed
)
{
...
// If the touch should consider clicks, send out an OnClick notification
if
(
currentTouch
.
clickNotification
!=
ClickNotification
.
None
)
{
float
time
=
RealTime
.
time
;
Notify
(
currentTouch
.
pressed
,
"OnClick"
,
null
)
;
<<<<<
Sometimes
this
action calls OnApplicationPause, then currentTouch becomes
null
if
(
currentTouch
.
clickTime
+
0
.
35f
>
time
)
<<<<<
and crash
!!!
{
Notify
(
currentTouch
.
pressed
,
"OnDoubleClick"
,
null
)
;
}
currentTouch
.
clickTime
=
time
;
}
...
}
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Bug with UICamera.ProcessTouch
«
Reply #1 on:
March 11, 2014, 04:54:21 PM »
This OnApplicationPause will keep the current touch:
void
OnApplicationPause
(
)
{
MouseOrTouch prev
=
currentTouch
;
if
(
useTouch
)
{
BetterList
<
int
>
ids
=
new
BetterList
<
int
>
(
)
;
foreach
(
KeyValuePair
<
int
, MouseOrTouch
>
pair
in
mTouches
)
{
if
(
pair
.
Value
!=
null
&&
pair
.
Value
.
pressed
)
{
currentTouch
=
pair
.
Value
;
currentTouchID
=
pair
.
Key
;
currentScheme
=
ControlScheme
.
Touch
;
currentTouch
.
clickNotification
=
ClickNotification
.
None
;
ProcessTouch
(
false
,
true
)
;
ids
.
Add
(
currentTouchID
)
;
}
}
for
(
int
i
=
0
;
i
<
ids
.
size
;
++
i
)
RemoveTouch
(
ids
[
i
]
)
;
}
if
(
useMouse
)
{
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
if
(
mMouse
[
i
]
.
pressed
)
{
currentTouch
=
mMouse
[
i
]
;
currentTouchID
=
-
1
-
i
;
currentKey
=
KeyCode
.
Mouse0
+
i
;
currentScheme
=
ControlScheme
.
Mouse
;
currentTouch
.
clickNotification
=
ClickNotification
.
None
;
ProcessTouch
(
false
,
true
)
;
}
}
}
if
(
useController
)
{
if
(
controller
.
pressed
)
{
currentTouch
=
controller
;
currentTouchID
=
-
100
;
currentScheme
=
ControlScheme
.
Controller
;
currentTouch
.
last
=
currentTouch
.
current
;
currentTouch
.
current
=
mCurrentSelection
;
currentTouch
.
clickNotification
=
ClickNotification
.
None
;
ProcessTouch
(
false
,
true
)
;
currentTouch
.
last
=
null
;
}
}
currentTouch
=
prev
;
}
Logged
avrilfeng
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 2
Re: Bug with UICamera.ProcessTouch
«
Reply #2 on:
February 22, 2016, 03:45:16 AM »
hey guys. i suffer this crash too. but i do not know where the code need to add, the UICamera?
Logged
avrilfeng
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 2
Re: Bug with UICamera.ProcessTouch
«
Reply #3 on:
February 22, 2016, 04:17:33 AM »
hey! I have checked the UIcamera and found the code exist yet. my ngui is 3.8.0. the situation occured when i click uibutton to open another ui
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Bug with UICamera.ProcessTouch
«
Reply #4 on:
February 22, 2016, 07:09:32 PM »
What crash? Nothing in NGUI will ever cause a crash. 3.8.0 is also extremely out of date, and only the latest version of NGUI is supported at all times.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Bug with UICamera.ProcessTouch