public void AnimateWaterSize(Vector2 targetSize, float duration, WaterAnimationConstraint constraint, WaterAnimationWrapMode wrapMode = WaterAnimationWrapMode.Once) { if (targetSize.x <= 0f) { targetSize.x = 0.001f; } if (targetSize.y <= 0f) { targetSize.y = 0.001f; } _animationTargetSize = targetSize; _animationInitialSize = _mainModule.WaterSize; _animationDuration = Mathf.Clamp(duration, 0f, float.MaxValue); _animationConstraints = constraint; _animationWrapMode = wrapMode; _isAnimatingWaterSize = true; }
protected void AnimateSize(Vector2 targetSize, float duration, WaterAnimationConstraint constraint, WaterAnimationWrapMode wrapMode = WaterAnimationWrapMode.Once) { if (targetSize.x <= 0f) { targetSize.x = 0.001f; } if (targetSize.y <= 0f) { targetSize.y = 0.001f; } _animationTargetSize = targetSize; _animationInitialSize = new Vector2(_mainModule.Width, _mainModule.Height); _animationDuration = Mathf.Clamp(duration, 0.001f, float.MaxValue); _animationConstraints = constraint; _animationWrapMode = wrapMode; _animationElapsedTime = 0f; _isAnimatingSize = true; }
public void AnimateWaterfallSize(Vector2 targetSize, float duration, WaterAnimationConstraint constraint, WaterAnimationWrapMode wrapMode = WaterAnimationWrapMode.Once) { AnimateSize(targetSize, duration, constraint, wrapMode); }
private bool HasConstraintDefined(WaterAnimationConstraint constraint) { return((_animationConstraints & constraint) == constraint); }