Hey, so…I’m looking around, and I’m not understanding exactly how to call a function once an iTween is finished.
I want a box to increase in scale and then shrink to Vector3.zero…here’s my code currently. Do I need a hashtable for this? I’m not “getting it” yet.
Cheers,
Simon
if(shrink)
{
iTween.ScaleTo(thisplacard, Vector3(1.25, 1.25, 0), .125, "onComplete", "ShrinkDown");
if(thisplacard.transform.localScale == Vector3.zero)
{
if(Random.value > .5) blinkout = Instantiate (blinkparticle2, thisplacard.transform.position, Quaternion.identity);
else blinkout = Instantiate (blinkparticle, thisplacard.transform.position, Quaternion.identity);
Destroy(thisplacard);
}
}
//THEN....
function ShrinkDown()
{
iTween.ScaleTo(thisplacard, Vector3.zero, .25);
}