DOShakeAnchorPos Method
DOShakeAnchorPos(RectTransform, float, float, int, float, bool, bool, ShakeRandomnessMode)
public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, float strength = 100, int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true, ShakeRandomnessMode randomnessMode = null)
Shakes a RectTransform's anchoredPosition with the given values. Also stores the RectTransform as the tween's target so it can be used for filtered operations
Parameters
targetRectTransformdurationfloatThe duration of the tween
strengthfloatThe shake strength
vibratointIndicates how much will the shake vibrate
randomnessfloatIndicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). Setting it to 0 will shake along a single direction.
snappingboolIf TRUE the tween will smoothly snap all values to integers
fadeOutboolIf TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not
randomnessModeShakeRandomnessModeRandomness mode
Returns
- Tweener
DOShakeAnchorPos(RectTransform, float, Vector2, int, float, bool, bool, ShakeRandomnessMode)
public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, Vector2 strength, int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true, ShakeRandomnessMode randomnessMode = null)
Shakes a RectTransform's anchoredPosition with the given values. Also stores the RectTransform as the tween's target so it can be used for filtered operations
Parameters
targetRectTransformdurationfloatThe duration of the tween
strengthVector2The shake strength on each axis
vibratointIndicates how much will the shake vibrate
randomnessfloatIndicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). Setting it to 0 will shake along a single direction.
snappingboolIf TRUE the tween will smoothly snap all values to integers
fadeOutboolIf TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not
randomnessModeShakeRandomnessModeRandomness mode
Returns
- Tweener