Welcome,
Guest
. Please
login
or
register
.
January 15, 2025, 08:47:30 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
(3.0.8 f6) UIKeyBinding.Update nullref
« previous
next »
Print
Pages: [
1
]
Author
Topic: (3.0.8 f6) UIKeyBinding.Update nullref (Read 1717 times)
Gwl
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 8
(3.0.8 f6) UIKeyBinding.Update nullref
«
on:
January 07, 2014, 09:17:14 AM »
There's no check if UICamera.currentTouch is null. If I read UICamera correctly, it's always being nullified in its Update so unless I'm missing something this can't work.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: (3.0.8 f6) UIKeyBinding.Update nullref
«
Reply #1 on:
January 07, 2014, 09:24:44 AM »
Yup, it's already fixed in the Pro version so you will see it in the next update. The fixed UIKeyBinding.Update function:
void
Update
(
)
{
if
(
keyCode
==
KeyCode
.
None
||
!
IsModifierActive
(
)
)
return
;
if
(
action
==
Action
.
PressAndClick
)
{
if
(
UICamera
.
inputHasFocus
)
return
;
UICamera
.
currentTouch
=
UICamera
.
controller
;
UICamera
.
currentScheme
=
UICamera
.
ControlScheme
.
Controller
;
UICamera
.
currentTouch
.
current
=
gameObject
;
if
(
Input
.
GetKeyDown
(
keyCode
)
)
{
UICamera
.
Notify
(
gameObject,
"OnPress"
,
true
)
;
}
if
(
Input
.
GetKeyUp
(
keyCode
)
)
{
UICamera
.
Notify
(
gameObject,
"OnPress"
,
false
)
;
UICamera
.
Notify
(
gameObject,
"OnClick"
,
null
)
;
}
UICamera
.
currentTouch
.
current
=
null
;
}
else
if
(
action
==
Action
.
Select
)
{
if
(
Input
.
GetKeyUp
(
keyCode
)
)
{
if
(
mIsInput
)
{
if
(
!
mIgnoreUp
&&
!
UICamera
.
inputHasFocus
)
{
UICamera
.
selectedObject
=
gameObject
;
}
mIgnoreUp
=
false
;
}
else
{
UICamera
.
selectedObject
=
gameObject
;
}
}
}
}
P.S. You likely won't have UICamera.controller, so you can replace that with UICamera.GetMouse(0).
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
(3.0.8 f6) UIKeyBinding.Update nullref