- Home /
Cooldown effect for a sprite
Hi all, What I need is i have a slot for an object which after placed on something, it has a recharge time say 10 seconds. I need a transparent grayed out effect which moves from left to right.. basically similar effect of a spell cooldown but not circular.
Ok, I know about alpha cutoff using cutout shader on a quad.But that works for opaque objects. I need a transparent sprite cut off. I know thats not possible using alpha cut off. But how will I achieve this for a sprite renderer?
Thanks for the help :)
Answer by RakshithAnand · Jul 02, 2014 at 05:30 PM
Well, I found a workaround for this.
What I thought of was place a grayed transparent sprite over the actual sprite and use iTween to reduce the scale of the grayed sprite in "x" in your required recharge time.
And since the scale will happen both sides, I just used a co routine which will move the sprite by half of the current scale till the scale becomes (0,1,1) either to left or right depending on whether you want right to left cool down or left to right.
Now I just hope this does not cause any big performance issues. If anyone knows whether doing this might affect the performance by a huge margin, then please let me know Thanks
Your answer
Follow this Question
Related Questions
Unity 5 2D Bloom Effect? 2 Answers
Cooldown effect in a button 4 Answers
Best ways to apply fancy effects on a plane? 1 Answer
Blur and stroke effect on a Sprite 1 Answer
Cooldown effect in GUI 0 Answers