Water Size Animation
It's possible to animate the water size in code using the method AnimateWaterSize(targetSize, duration, constraint, wrapMode).
- targetSize: [Vector2] sets the water target size.
- duration: [float] sets the animation duration in seconds.
-
constraint: [enum WaterAnimationConstraint] constraints the position of one/multiple water edge(s)
WaterAnimationConstraint enum
None, Top, Bottom, Left, Right, TopLeft, TopRight, BottomLeft, BottomRight
- wrapMode: [enum WaterAnimationWrapMode]
WaterAnimationWrapMode enum
- Once: Stops playing the animation once the target size is reached.
- Loop: The water size is reset to the initial size and the animation is restarted once the target size is reached.
- PingPong: When the target size is reached, the initial size is set to the new target size and the animation restarts. So the water size will ping-pong back and forth between the initial size and the target size.
Example
1 2 3 4 5 6 7 8 9 10 |
|