Welcome,
Guest
. Please
login
or
register
.
April 29, 2026, 12:58:06 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Widgets with alpha = 0 and colliders
« previous
next »
Print
Pages: [
1
]
Author
Topic: Widgets with alpha = 0 and colliders (Read 3866 times)
vallcrist
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 49
Widgets with alpha = 0 and colliders
«
on:
January 19, 2014, 03:48:54 PM »
Hello again. =)
Previously, when a sprite/widget had it's alpha value = 0, the collider was disabled automatically, has this changed, or am i doing something wrong?
Logged
Shifty Geezer
Full Member
Thank You
-Given: 7
-Receive: 9
Posts: 226
Re: Widgets with alpha = 0 and colliders
«
Reply #1 on:
January 19, 2014, 04:38:17 PM »
That's not how it presently is. I've written my own code to disable colliders. Added to NGUITools.cs
public
static
void
SetEnabled
(
GameObject t,
bool
on
)
{
// en/disables the BoxCollider of the control
BoxCollider
[
]
uielements
;
uielements
=
t
.
GetComponentsInChildren
<
BoxCollider
>
(
)
;
foreach
(
BoxCollider bc
in
uielements
)
{
bc
.
enabled
=
on
;
}
}
public
static
void
Enable
(
GameObject t
)
{
// enables the BoxCollider of the control and children, fades it in
SetEnabled
(
t,
true
)
;
TweenAlpha
.
Begin
(
t, 0
.
15f, 1f
)
;
}
public
static
void
Disable
(
GameObject t
)
{
// disables the BoxCollider of the control and children, fades it out
SetEnabled
(
t,
false
)
;
TweenAlpha
.
Begin
(
t, 0
.
15f, 0f
)
;
}
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Widgets with alpha = 0 and colliders
«
Reply #2 on:
January 20, 2014, 12:02:17 AM »
Was it ever like that? Thinking about it, auto-disabling the box collider on invisible widgets is a good idea, so I've gone ahead and done that for f2.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Widgets with alpha = 0 and colliders