public static Tweener DOShakeRotation(this Camera target, float duration, float strength = 90f, int vibrato = 10, float randomness = 90f, bool fadeOut = true) { return(DOTween.Shake(() => target.transform.localEulerAngles, delegate(Vector3 x) { target.transform.localRotation = Quaternion.Euler(x); }, duration, strength, vibrato, randomness, false, fadeOut).SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake)); }
/// <summary>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</summary> /// <param name="duration">The duration of the tween</param> /// <param name="strength">The shake strength on each axis</param> /// <param name="vibrato">Indicates how much will the shake vibrate</param> /// <param name="randomness">Indicates 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.</param> /// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param> /// <param name="fadeOut">If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not</param> public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, Vector2 strength, int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true) { return(DOTween.Shake(() => target.anchoredPosition, x => target.anchoredPosition = x, duration, strength, vibrato, randomness, fadeOut) .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping)); }
public static Tweener DOShakePosition(this Camera target, float duration, float strength = 3f, int vibrato = 10, float randomness = 90f) { return(DOTween.Shake(() => target.transform.localPosition, delegate(Vector3 x) { target.transform.localPosition = x; }, duration, strength, vibrato, randomness, true).SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetCameraShakePosition)); }
public static Tweener DOShakeRotation(this Transform target, float duration, Vector3 strength, int vibrato = 10, float randomness = 90f) { return(DOTween.Shake(() => target.localEulerAngles, delegate(Vector3 x) { target.localRotation = Quaternion.Euler(x); }, duration, strength, vibrato, randomness).SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake)); }
public static Tweener DOShakeScale(this Transform target, float duration, Vector3 strength, int vibrato = 10, float randomness = 90f) { return(DOTween.Shake(() => target.localScale, delegate(Vector3 x) { target.localScale = x; }, duration, strength, vibrato, randomness).SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake)); }
public static Tweener DOShakePosition(this Transform target, float duration, Vector3 strength, int vibrato = 10, float randomness = 90f, bool snapping = false) { return(DOTween.Shake(() => target.localPosition, delegate(Vector3 x) { target.localPosition = x; }, duration, strength, vibrato, randomness).SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping)); }
public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, float strength = 100f, int vibrato = 10, float randomness = 90f, bool snapping = false, bool fadeOut = true) { return(DOTween.Shake(() => target.anchoredPosition, delegate(Vector3 x) { target.anchoredPosition = x; }, duration, strength, vibrato, randomness, ignoreZAxis: true, fadeOut).SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake) .SetOptions(snapping)); }
/// <summary>Shakes a Transform's localPosition with the given values.</summary> /// <param name="duration">The duration of the tween</param> /// <param name="strength">The shake strength</param> /// <param name="vibrato">Indicates how much will the shake vibrate</param> /// <param name="randomness">Indicates 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.</param> /// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param> public static Tweener DOShakePosition(this Transform target, float duration, float strength = 1, int vibrato = 10, float randomness = 90, bool snapping = false) { return(DOTween.Shake(() => target.localPosition, x => target.localPosition = x, duration, strength, vibrato, randomness, false) .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping)); }
public static TweenerCore <Vector3, Vector3[], Vector3ArrayOptions> Shake(DOGetter <Vector3> getter, DOSetter <Vector3> setter, float duration, Vector3 strength, int vibrato = 10, float randomness = 90f) { return(DOTween.Shake(getter, setter, duration, strength, vibrato, randomness, false, true)); }
public static TweenerCore <Vector3, Vector3[], Vector3ArrayOptions> Shake(DOGetter <Vector3> getter, DOSetter <Vector3> setter, float duration, float strength = 3f, int vibrato = 10, float randomness = 90f, bool ignoreZAxis = true) { return(DOTween.Shake(getter, setter, duration, new Vector3(strength, strength, strength), vibrato, randomness, ignoreZAxis, false)); }
public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, Vector2 strength, int vibrato = 10, float randomness = 90f, bool snapping = false) { return(DOTween.Shake(() => (Vector3)target.anchoredPosition, delegate(Vector3 x) { target.anchoredPosition = x; }, duration, (Vector3)strength, vibrato, randomness).SetTarget <TweenerCore <Vector3, Vector3[], Vector3ArrayOptions> >(target).SetSpecialStartupMode <TweenerCore <Vector3, Vector3[], Vector3ArrayOptions> >(SpecialStartupMode.SetShake).SetOptions(snapping)); }
/// <summary>Shakes a Transform's localScale.</summary> /// <param name="duration">The duration of the tween</param> /// <param name="strength">The shake strength</param> /// <param name="vibrato">Indicates how much will the shake vibrate</param> /// <param name="randomness">Indicates 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.</param> public static Tweener DOShakeScale(this Transform target, float duration, float strength = 1, int vibrato = 10, float randomness = 90) { return(DOTween.Shake(() => target.localScale, x => target.localScale = x, duration, strength, vibrato, randomness, false) .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake)); }
public static Tweener DOShakeScale(this Transform target, float duration, float strength = 1f, int vibrato = 10, float randomness = 90f) { return(DOTween.Shake(() => target.localScale, delegate(Vector3 x) { target.localScale = x; }, duration, strength, vibrato, randomness, false).SetTarget <TweenerCore <Vector3, Vector3[], Vector3ArrayOptions> >(target).SetSpecialStartupMode <TweenerCore <Vector3, Vector3[], Vector3ArrayOptions> >(SpecialStartupMode.SetShake)); }
public static Tweener DOShakeRotation(this Camera target, float duration, float strength = 90f, int vibrato = 10, float randomness = 90f) { return(DOTween.Shake(() => target.transform.localEulerAngles, delegate(Vector3 x) { target.transform.localRotation = Quaternion.Euler(x); }, duration, strength, vibrato, randomness, false).SetTarget <TweenerCore <Vector3, Vector3[], Vector3ArrayOptions> >(target).SetSpecialStartupMode <TweenerCore <Vector3, Vector3[], Vector3ArrayOptions> >(SpecialStartupMode.SetShake)); }
public static Tweener DOShakePosition(this Camera target, float duration, Vector3 strength, int vibrato = 10, float randomness = 90f) { return(DOTween.Shake(() => target.transform.localPosition, delegate(Vector3 x) { target.transform.localPosition = x; }, duration, strength, vibrato, randomness).SetTarget <TweenerCore <Vector3, Vector3[], Vector3ArrayOptions> >(target).SetSpecialStartupMode <TweenerCore <Vector3, Vector3[], Vector3ArrayOptions> >(SpecialStartupMode.SetCameraShakePosition)); }
/// <summary>Shakes a Camera's localRotation. /// Also stores the camera as the tween's target so it can be used for filtered operations</summary> /// <param name="duration">The duration of the tween</param> /// <param name="strength">The shake strength</param> /// <param name="vibrato">Indicates how much will the shake vibrate</param> /// <param name="randomness">Indicates 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.</param> public static Tweener DOShakeRotation(this Camera target, float duration, float strength = 90, int vibrato = 10, float randomness = 90) { return(DOTween.Shake(() => target.transform.localEulerAngles, x => target.transform.localRotation = Quaternion.Euler(x), duration, strength, vibrato, randomness, false) .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake)); }
/// <summary>Shakes a Camera's localPosition along its relative X Y axes with the given values. /// Also stores the camera as the tween's target so it can be used for filtered operations</summary> /// <param name="duration">The duration of the tween</param> /// <param name="strength">The shake strength on each axis</param> /// <param name="vibrato">Indicates how much will the shake vibrate</param> /// <param name="randomness">Indicates 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.</param> public static Tweener DOShakePosition(this Camera target, float duration, Vector3 strength, int vibrato = 10, float randomness = 90) { return(DOTween.Shake(() => target.transform.localPosition, x => target.transform.localPosition = x, duration, strength, vibrato, randomness) .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetCameraShakePosition)); }