Hi,
i have a rather weird issue with iTween.ScaleTo. As you can see in the gif the ScaleTo is only called on the second try after i move a card to the upper row. Funnily before i move a card to the upper row i can pickup and scale all cards as expected. This issue seems to come from scaling it down when putting in the upper row. The onScaleComplete is also never fired on the first try after it’s moved to the upper row, but the ToggleDragScale function is called properly.
image
The Code looks like this, it’s called when the card is picked up and also when it’s put into the top box:
public void ToggleDragScale(bool toScaled)
{
if(toScaled)
{
print ("scale activated");
iTween.ScaleTo(gameObject, iTween.Hash(
"x", 1.1f,
"y", 1.1f,
"islocal", true,
"easetype", iTween.EaseType.easeOutQuad,
"time", 0.2f,
"onComplete", "OnScaleComplete",
"onCompleteTarget", gameObject
));
}
else
{
print ("scale deactivated");
iTween.ScaleTo(gameObject, iTween.Hash(
"x", 1f,
"y", 1f,
"islocal", true,
"easetype", iTween.EaseType.easeInOutSine,
"time", 0.2f
));
}
}
void OnScaleComplete()
{
print ("scale complete");
}