Welcome,
Guest
. Please
login
or
register
.
April 29, 2026, 08:59:28 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Tween with duration 0 issue
« previous
next »
Print
Pages: [
1
]
Author
Topic: Tween with duration 0 issue (Read 6149 times)
Mistborn
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 6
Tween with duration 0 issue
«
on:
January 10, 2016, 09:38:16 PM »
The tween with duration 0 is malfunctioning since updated from 3.9.6 to 3.9.6c. I found out that the mFactor in UITweener.Update now always is 0 in the first update, which causes tween nothing.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Tween with duration 0 issue
«
Reply #1 on:
January 11, 2016, 05:29:38 PM »
Add "if (duration == 0f) return 1000f;" to UITweener.amountPerDelta:
public
float
amountPerDelta
{
get
{
if
(
duration
==
0f
)
return
1000f
;
if
(
mDuration
!=
duration
)
{
mDuration
=
duration
;
mAmountPerDelta
=
Mathf
.
Abs
(
1f
/
duration
)
*
Mathf
.
Sign
(
mAmountPerDelta
)
;
}
return
mAmountPerDelta
;
}
}
«
Last Edit: January 11, 2016, 06:21:32 PM by ArenMook
»
Logged
Mistborn
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 6
Re: Tween with duration 0 issue
«
Reply #2 on:
January 12, 2016, 12:08:43 AM »
Thanks you for quickly reply. I tried the fix you provide, but it still tween nothing. Actually no mater the value of amountPerDelta is the mFactor always be 0 because of 0 delta in the first update.
if
(
!
mStarted
)
{
delta
=
0
;
mStarted
=
true
;
mStartTime
=
time
+
delay
;
}
if
(
time
<
mStartTime
)
return
;
// Advance the sampling factor
mFactor
+=
amountPerDelta
*
delta
;
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Tween with duration 0 issue
«
Reply #3 on:
January 13, 2016, 07:10:06 PM »
Ah yes, I see what you mean. Well, just change the factor increment line to:
mFactor
+=
(
duration
==
0f
)
?
1f
:
amountPerDelta
*
delta
;
Logged
Mistborn
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 6
Re: Tween with duration 0 issue
«
Reply #4 on:
January 13, 2016, 09:35:02 PM »
Works perfectly! Thanks you so much!
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Tween with duration 0 issue