Is there a way to sustain older values of the sine wave on a large horizontal canvas upon dynamically changing amplitude and frequency?
A downloadable tool
WavySprite is an asset for Unity that creates a wave animation for an image.
It creates a quad and allows you to set a texture, a number of horizontal and vertical divisions for it and multiple parameters to control the sine wave. The animation itself is done by a shader, not by a script.
To add a WavySprite object to you scene, go to:
GameObject > 2D Object > WavySprite
Hit play to see the animation. You can adjust parameters from the inspector or from code on the fly.
2017-05-02 - Added support for sorting layers. Works same way as for sprites.
2017-05-11 - Added a button to scale the GameObject to the size of original texture.
2017-10-27 - Added a Tint option that works same way as for sprites.
Click download now to get access to the following files:
Log in with your itch.io account to leave a comment.
If you mean that you want to change the values back and forth during gameplay then you can do it with code.
This is an awesome little tool! It would be great if it supported Sorting Layers as well. Would that be possible with this shader?
I don't think so. But I'll look into this. It's an important feature.
I've just added a support for sorting layers. Should be no different from using same properties in sprites.