Welcome,
Guest
. Please
login
or
register
.
February 17, 2025, 11:48:03 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Fix for UISpriteAnimation bug...
« previous
next »
Print
Pages: [
1
]
Author
Topic: Fix for UISpriteAnimation bug... (Read 2517 times)
terence
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 14
Fix for UISpriteAnimation bug...
«
on:
November 21, 2012, 07:46:32 PM »
UISpriteAnimation has a bug where it calls makePixelPerfect after setting the sprite. Obviously if you resized the sprite that would cause problems. So to fix it I added an member variable to enable/disable this. Not sure if should post the fixes but here are the code portions.
UISpriteAnimationInspector line 54 onward
bool
makePixelPerfect
=
EditorGUILayout
.
Toggle
(
"Make Pixel Perfect"
,anim
.
makePixelPerfect
)
;
if
(
anim
.
makePixelPerfect
!=
makePixelPerfect
)
{
NGUIEditorTools
.
RegisterUndo
(
"Sprite Animation Change"
, anim
)
;
anim
.
makePixelPerfect
=
makePixelPerfect
;
EditorUtility
.
SetDirty
(
anim
)
;
}
UISpriteAnimation
[
HideInInspector
]
[
SerializeField
]
bool
mMakePixelPerfect
=
true
;
// Line 21
public
bool
loop
{
get
{
return
mLoop
;
}
set
{
mLoop
=
value
;
}
}
public
bool
makePixelPerfect
{
get
{
return
mMakePixelPerfect
;
}
set
{
mMakePixelPerfect
=
value
;
}
}
// Around Line 54
// Around Line 88
if
(
mActive
)
{
mSprite
.
spriteName
=
mSpriteNames
[
mIndex
]
;
if
(
mMakePixelPerfect
)
mSprite
.
MakePixelPerfect
(
)
;
}
Hope this make it into the next build..;P
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Fix for UISpriteAnimation bug...
«
Reply #1 on:
November 22, 2012, 12:34:24 AM »
I suggest resizing the parent, not the sprite that has the animation on it. It's exactly the same as you trying to resize an animated model that happens to have its root scale animated as well. Just leads to confusion.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Fix for UISpriteAnimation bug...