summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/Demigiant/DOTweenPro/DOTweenTk2d.cs.addon
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-10-13 10:33:05 +0800
committerchai <chaifix@163.com>2020-10-13 10:33:05 +0800
commitfc6de82e75310b4c007d80753a5f58e6692f4855 (patch)
treee6d8d9226595a6727d43f18a218f53533101a4e0 /Assets/ThirdParty/Demigiant/DOTweenPro/DOTweenTk2d.cs.addon
parent8cd16fb71177bb61a9475284d944bc6aba30740e (diff)
+misc
Diffstat (limited to 'Assets/ThirdParty/Demigiant/DOTweenPro/DOTweenTk2d.cs.addon')
-rw-r--r--Assets/ThirdParty/Demigiant/DOTweenPro/DOTweenTk2d.cs.addon284
1 files changed, 142 insertions, 142 deletions
diff --git a/Assets/ThirdParty/Demigiant/DOTweenPro/DOTweenTk2d.cs.addon b/Assets/ThirdParty/Demigiant/DOTweenPro/DOTweenTk2d.cs.addon
index f5e5ef17..9c18d658 100644
--- a/Assets/ThirdParty/Demigiant/DOTweenPro/DOTweenTk2d.cs.addon
+++ b/Assets/ThirdParty/Demigiant/DOTweenPro/DOTweenTk2d.cs.addon
@@ -1,143 +1,143 @@
-// Author: Daniele Giardini - http://www.demigiant.com
-// Created: 2014/10/27 15:59
-//
-// License Copyright (c) Daniele Giardini.
-// This work is subject to the terms at http://dotween.demigiant.com/license.php
-
-using UnityEngine;
-
-namespace DG.Tweening
-{
- /// <summary>
- /// Methods that extend 2D Toolkit objects and allow to directly create and control tweens from their instances.
- /// </summary>
- public static class ShortcutExtensionsTk2d
- {
- #region Sprite
-
- /// <summary>Tweens a 2D Toolkit Sprite's dimensions to the given value.
- /// Also stores the Sprite as the tween's target so it can be used for filtered operations</summary>
- /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
- public static Tweener DOScale(this tk2dBaseSprite target, Vector3 endValue, float duration)
- {
- return DOTween.To(() => target.scale, x => target.scale = x, endValue, duration)
- .SetTarget(target);
- }
- /// <summary>Tweens a Sprite's dimensions to the given value.
- /// Also stores the Sprite as the tween's target so it can be used for filtered operations</summary>
- /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
- public static Tweener DOScaleX(this tk2dBaseSprite target, float endValue, float duration)
- {
- return DOTween.To(() => target.scale, x => target.scale = x, new Vector3(endValue, 0, 0), duration)
- .SetOptions(AxisConstraint.X)
- .SetTarget(target);
- }
- /// <summary>Tweens a Sprite's dimensions to the given value.
- /// Also stores the Sprite as the tween's target so it can be used for filtered operations</summary>
- /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
- public static Tweener DOScaleY(this tk2dBaseSprite target, float endValue, float duration)
- {
- return DOTween.To(() => target.scale, x => target.scale = x, new Vector3(0, endValue, 0), duration)
- .SetOptions(AxisConstraint.Y)
- .SetTarget(target);
- }
- /// <summary>Tweens a Sprite's dimensions to the given value.
- /// Also stores the Sprite as the tween's target so it can be used for filtered operations</summary>
- /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
- public static Tweener DOScaleZ(this tk2dBaseSprite target, float endValue, float duration)
- {
- return DOTween.To(() => target.scale, x => target.scale = x, new Vector3(0, 0, endValue), duration)
- .SetOptions(AxisConstraint.Z)
- .SetTarget(target);
- }
-
- /// <summary>Tweens a 2D Toolkit Sprite's color to the given value.
- /// Also stores the Sprite as the tween's target so it can be used for filtered operations</summary>
- /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
- public static Tweener DOColor(this tk2dBaseSprite target, Color endValue, float duration)
- {
- return DOTween.To(() => target.color, x => target.color = x, endValue, duration)
- .SetTarget(target);
- }
-
- /// <summary>Tweens a 2D Toolkit Sprite's alpha color to the given value.
- /// Also stores the Sprite as the tween's target so it can be used for filtered operations</summary>
- /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
- public static Tweener DOFade(this tk2dBaseSprite target, float endValue, float duration)
- {
- return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration)
- .SetTarget(target);
- }
-
- #endregion
-
- #region tk2dSlicedSprite
-
- /// <summary>Tweens a 2D Toolkit SlicedSprite's dimensions to the given value.
- /// Also stores the SlicedSprite as the tween's target so it can be used for filtered operations</summary>
- /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
- public static Tweener DOScale(this tk2dSlicedSprite target, Vector2 endValue, float duration)
- {
- return DOTween.To(() => target.dimensions, x => target.dimensions = x, endValue, duration)
- .SetTarget(target);
- }
- /// <summary>Tweens a SlicedSprite's dimensions to the given value.
- /// Also stores the SlicedSprite as the tween's target so it can be used for filtered operations</summary>
- /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
- public static Tweener DOScaleX(this tk2dSlicedSprite target, float endValue, float duration)
- {
- return DOTween.To(() => target.dimensions, x => target.dimensions = x, new Vector2(endValue, 0), duration)
- .SetOptions(AxisConstraint.X)
- .SetTarget(target);
- }
- /// <summary>Tweens a SlicedSprite's dimensions to the given value.
- /// Also stores the SlicedSprite as the tween's target so it can be used for filtered operations</summary>
- /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
- public static Tweener DOScaleY(this tk2dSlicedSprite target, float endValue, float duration)
- {
- return DOTween.To(() => target.dimensions, x => target.dimensions = x, new Vector2(0, endValue), duration)
- .SetOptions(AxisConstraint.Y)
- .SetTarget(target);
- }
-
- #endregion
-
- #region TextMesh
-
- /// <summary>Tweens a 2D Toolkit TextMesh's color to the given value.
- /// Also stores the TextMesh as the tween's target so it can be used for filtered operations</summary>
- /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
- public static Tweener DOColor(this tk2dTextMesh target, Color endValue, float duration)
- {
- return DOTween.To(() => target.color, x => target.color = x, endValue, duration)
- .SetTarget(target);
- }
-
- /// <summary>Tweens a 2D Toolkit TextMesh's alpha color to the given value.
- /// Also stores the TextMesh as the tween's target so it can be used for filtered operations</summary>
- /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
- public static Tweener DOFade(this tk2dTextMesh target, float endValue, float duration)
- {
- return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration)
- .SetTarget(target);
- }
-
- /// <summary>Tweens a tk2dTextMesh's text to the given value.
- /// Also stores the tk2dTextMesh as the tween's target so it can be used for filtered operations</summary>
- /// <param name="endValue">The end string to tween to</param><param name="duration">The duration of the tween</param>
- /// <param name="richTextEnabled">If TRUE (default), rich text will be interpreted correctly while animated,
- /// otherwise all tags will be considered as normal text</param>
- /// <param name="scrambleMode">The type of scramble mode to use, if any</param>
- /// <param name="scrambleChars">A string containing the characters to use for scrambling.
- /// Use as many characters as possible (minimum 10) because DOTween uses a fast scramble mode which gives better results with more characters.
- /// Leave it to NULL (default) to use default ones</param>
- public static Tweener DOText(this tk2dTextMesh target, string endValue, float duration, bool richTextEnabled = true, ScrambleMode scrambleMode = ScrambleMode.None, string scrambleChars = null)
- {
- return DOTween.To(() => target.text, x => target.text = x, endValue, duration)
- .SetOptions(richTextEnabled, scrambleMode, scrambleChars)
- .SetTarget(target);
- }
-
- #endregion
- }
+// Author: Daniele Giardini - http://www.demigiant.com
+// Created: 2014/10/27 15:59
+//
+// License Copyright (c) Daniele Giardini.
+// This work is subject to the terms at http://dotween.demigiant.com/license.php
+
+using UnityEngine;
+
+namespace DG.Tweening
+{
+ /// <summary>
+ /// Methods that extend 2D Toolkit objects and allow to directly create and control tweens from their instances.
+ /// </summary>
+ public static class ShortcutExtensionsTk2d
+ {
+ #region Sprite
+
+ /// <summary>Tweens a 2D Toolkit Sprite's dimensions to the given value.
+ /// Also stores the Sprite as the tween's target so it can be used for filtered operations</summary>
+ /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
+ public static Tweener DOScale(this tk2dBaseSprite target, Vector3 endValue, float duration)
+ {
+ return DOTween.To(() => target.scale, x => target.scale = x, endValue, duration)
+ .SetTarget(target);
+ }
+ /// <summary>Tweens a Sprite's dimensions to the given value.
+ /// Also stores the Sprite as the tween's target so it can be used for filtered operations</summary>
+ /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
+ public static Tweener DOScaleX(this tk2dBaseSprite target, float endValue, float duration)
+ {
+ return DOTween.To(() => target.scale, x => target.scale = x, new Vector3(endValue, 0, 0), duration)
+ .SetOptions(AxisConstraint.X)
+ .SetTarget(target);
+ }
+ /// <summary>Tweens a Sprite's dimensions to the given value.
+ /// Also stores the Sprite as the tween's target so it can be used for filtered operations</summary>
+ /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
+ public static Tweener DOScaleY(this tk2dBaseSprite target, float endValue, float duration)
+ {
+ return DOTween.To(() => target.scale, x => target.scale = x, new Vector3(0, endValue, 0), duration)
+ .SetOptions(AxisConstraint.Y)
+ .SetTarget(target);
+ }
+ /// <summary>Tweens a Sprite's dimensions to the given value.
+ /// Also stores the Sprite as the tween's target so it can be used for filtered operations</summary>
+ /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
+ public static Tweener DOScaleZ(this tk2dBaseSprite target, float endValue, float duration)
+ {
+ return DOTween.To(() => target.scale, x => target.scale = x, new Vector3(0, 0, endValue), duration)
+ .SetOptions(AxisConstraint.Z)
+ .SetTarget(target);
+ }
+
+ /// <summary>Tweens a 2D Toolkit Sprite's color to the given value.
+ /// Also stores the Sprite as the tween's target so it can be used for filtered operations</summary>
+ /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
+ public static Tweener DOColor(this tk2dBaseSprite target, Color endValue, float duration)
+ {
+ return DOTween.To(() => target.color, x => target.color = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ /// <summary>Tweens a 2D Toolkit Sprite's alpha color to the given value.
+ /// Also stores the Sprite as the tween's target so it can be used for filtered operations</summary>
+ /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
+ public static Tweener DOFade(this tk2dBaseSprite target, float endValue, float duration)
+ {
+ return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ #endregion
+
+ #region tk2dSlicedSprite
+
+ /// <summary>Tweens a 2D Toolkit SlicedSprite's dimensions to the given value.
+ /// Also stores the SlicedSprite as the tween's target so it can be used for filtered operations</summary>
+ /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
+ public static Tweener DOScale(this tk2dSlicedSprite target, Vector2 endValue, float duration)
+ {
+ return DOTween.To(() => target.dimensions, x => target.dimensions = x, endValue, duration)
+ .SetTarget(target);
+ }
+ /// <summary>Tweens a SlicedSprite's dimensions to the given value.
+ /// Also stores the SlicedSprite as the tween's target so it can be used for filtered operations</summary>
+ /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
+ public static Tweener DOScaleX(this tk2dSlicedSprite target, float endValue, float duration)
+ {
+ return DOTween.To(() => target.dimensions, x => target.dimensions = x, new Vector2(endValue, 0), duration)
+ .SetOptions(AxisConstraint.X)
+ .SetTarget(target);
+ }
+ /// <summary>Tweens a SlicedSprite's dimensions to the given value.
+ /// Also stores the SlicedSprite as the tween's target so it can be used for filtered operations</summary>
+ /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
+ public static Tweener DOScaleY(this tk2dSlicedSprite target, float endValue, float duration)
+ {
+ return DOTween.To(() => target.dimensions, x => target.dimensions = x, new Vector2(0, endValue), duration)
+ .SetOptions(AxisConstraint.Y)
+ .SetTarget(target);
+ }
+
+ #endregion
+
+ #region TextMesh
+
+ /// <summary>Tweens a 2D Toolkit TextMesh's color to the given value.
+ /// Also stores the TextMesh as the tween's target so it can be used for filtered operations</summary>
+ /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
+ public static Tweener DOColor(this tk2dTextMesh target, Color endValue, float duration)
+ {
+ return DOTween.To(() => target.color, x => target.color = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ /// <summary>Tweens a 2D Toolkit TextMesh's alpha color to the given value.
+ /// Also stores the TextMesh as the tween's target so it can be used for filtered operations</summary>
+ /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
+ public static Tweener DOFade(this tk2dTextMesh target, float endValue, float duration)
+ {
+ return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ /// <summary>Tweens a tk2dTextMesh's text to the given value.
+ /// Also stores the tk2dTextMesh as the tween's target so it can be used for filtered operations</summary>
+ /// <param name="endValue">The end string to tween to</param><param name="duration">The duration of the tween</param>
+ /// <param name="richTextEnabled">If TRUE (default), rich text will be interpreted correctly while animated,
+ /// otherwise all tags will be considered as normal text</param>
+ /// <param name="scrambleMode">The type of scramble mode to use, if any</param>
+ /// <param name="scrambleChars">A string containing the characters to use for scrambling.
+ /// Use as many characters as possible (minimum 10) because DOTween uses a fast scramble mode which gives better results with more characters.
+ /// Leave it to NULL (default) to use default ones</param>
+ public static Tweener DOText(this tk2dTextMesh target, string endValue, float duration, bool richTextEnabled = true, ScrambleMode scrambleMode = ScrambleMode.None, string scrambleChars = null)
+ {
+ return DOTween.To(() => target.text, x => target.text = x, endValue, duration)
+ .SetOptions(richTextEnabled, scrambleMode, scrambleChars)
+ .SetTarget(target);
+ }
+
+ #endregion
+ }
} \ No newline at end of file