Welcome,
Guest
. Please
login
or
register
.
November 13, 2024, 08:25:27 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
How to use UIWidget.HitCheck delegate in my program.
« previous
next »
Print
Pages: [
1
]
Author
Topic: How to use UIWidget.HitCheck delegate in my program. (Read 2714 times)
pawankumar113
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 11
How to use UIWidget.HitCheck delegate in my program.
«
on:
November 12, 2014, 04:48:01 AM »
How I can use UIWidget.HitCheck to detect a particular Sprite or GameObject hit or not when i touches on Screen.
I tried to find out example but i did not find any example.
gameObject
.
GetComponent
<
UIWidget
>
(
)
.
hitCheck
=
HitCheck
;
bool
HitCheck
(
Vector3 worldPosition
)
{
// Here what code to write to know whether a particular gameObject hit or not.
}
Thanks in advance.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: How to use UIWidget.HitCheck delegate in my program.
«
Reply #1 on:
November 12, 2014, 07:52:16 AM »
That's not what hit check is used for.
Hit check is to perform additional checking on the widget, for example sprite alpha sampling.
Logged
pawankumar113
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 11
Re: How to use UIWidget.HitCheck delegate in my program.
«
Reply #2 on:
November 12, 2014, 08:04:24 AM »
So How can it detect which gameObject hit in NGUI such as RayCast used to detect that whether
gameObject hit or not. kindly guide me.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: How to use UIWidget.HitCheck delegate in my program.
«
Reply #3 on:
November 12, 2014, 08:07:10 AM »
Again, that's not what it's used for. Hit check is to do additional checking such as alpha. I am not sure how much more clear I can explain it.
Raycasting is done in UICamera.Raycast.
Logged
pawankumar113
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 11
Re: How to use UIWidget.HitCheck delegate in my program.
«
Reply #4 on:
November 12, 2014, 08:47:08 AM »
Sorry but i was asking can i achieve this task by another way or method.
Bye the way i can use UICamera.lastHit
Thanks.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: How to use UIWidget.HitCheck delegate in my program.
«
Reply #5 on:
November 14, 2014, 04:24:36 AM »
NGUI's events always automatically go to the top-most widget. There is no need for any additional checks here. What is it are you trying to do, exactly?
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
How to use UIWidget.HitCheck delegate in my program.