diff --git a/.gitignore b/.gitignore
index 703753c..033680a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,6 +34,10 @@ zz UnityTests*
zzTestBuilds
*.tmp
*.pdb
+*.DotSettings
UnityTests.Unity5BETA
-biz
\ No newline at end of file
+UnityTests.Unity5 - LastVersionBeforeModules
+ModulesTest.Unity2018
+biz
+zzTemp
\ No newline at end of file
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.XML b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.XML
index 2c3ec4d..0001102 100644
--- a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.XML
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.XML
@@ -179,6 +179,26 @@
Public only so custom shortcuts can access some of these methods
+
+
+ INTERNAL: used by DO shortcuts and Modules to set special startup mode
+
+
+
+
+ INTERNAL: used by DO shortcuts and Modules to set the tween as blendable
+
+
+
+
+ INTERNAL: used by DO shortcuts and Modules to prevent a tween from using a From setup even if passed
+
+
+
+
+ Used to dispatch commands that need to be captured externally, usually by Modules
+
+
Returns a Vector3 with z = 0
@@ -195,6 +215,11 @@
because the latter fails (in some cases) when assigning a Vector3 to a transform.position and then checking it.
+
+
+ Looks for the type withing all possible project assembly names
+
+
Struct that stores two colors (used for LineRenderer tweens)
@@ -1239,16 +1264,6 @@
Methods that extend known Unity objects and allow to directly create and control tweens from their instances
-
- Tweens an AudioSource's volume to the given value.
- Also stores the AudioSource as the tween's target so it can be used for filtered operations
- The end value to reach (0 to 1)The duration of the tween
-
-
- Tweens an AudioSource's pitch to the given value.
- Also stores the AudioSource as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
Tweens a Camera's aspect to the given value.
Also stores the camera as the tween's target so it can be used for filtered operations
@@ -1418,81 +1433,6 @@
The name of the material property to tween
The duration of the tween
-
- Tweens a Rigidbody's position to the given value.
- Also stores the rigidbody as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Rigidbody's X position to the given value.
- Also stores the rigidbody as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Rigidbody's Y position to the given value.
- Also stores the rigidbody as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Rigidbody's Z position to the given value.
- Also stores the rigidbody as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Rigidbody's rotation to the given value.
- Also stores the rigidbody as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- Rotation mode
-
-
- Tweens a Rigidbody's rotation so that it will look towards the given position.
- Also stores the rigidbody as the tween's target so it can be used for filtered operations
- The position to look atThe duration of the tween
- Eventual axis constraint for the rotation
- The vector that defines in which direction up is (default: Vector3.up)
-
-
- Tweens a Rigidbody's position to the given value, while also applying a jump effect along the Y axis.
- Returns a Sequence instead of a Tweener.
- Also stores the Rigidbody as the tween's target so it can be used for filtered operations
- The end value to reach
- Power of the jump (the max height of the jump is represented by this plus the final Y offset)
- Total number of jumps
- The duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Rigidbody's position through the given path waypoints, using the chosen path algorithm.
- Also stores the Rigidbody as the tween's target so it can be used for filtered operations.
- NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.
- BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug).
- If you plan to publish there you should use a regular transform.DOPath.
- The waypoints to go through
- The duration of the tween
- The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)
- The path mode: 3D, side-scroller 2D, top-down 2D
- The resolution of the path (useless in case of Linear paths): higher resolutions make for more detailed curved paths but are more expensive.
- Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints
- The color of the path (shown when gizmos are active in the Play panel and the tween is running)
-
-
- Tweens a Rigidbody's localPosition through the given path waypoints, using the chosen path algorithm.
- Also stores the Rigidbody as the tween's target so it can be used for filtered operations
- NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.
- BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug).
- If you plan to publish there you should use a regular transform.DOLocalPath.
- The waypoint to go through
- The duration of the tween
- The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)
- The path mode: 3D, side-scroller 2D, top-down 2D
- The resolution of the path: higher resolutions make for more detailed curved paths but are more expensive.
- Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints
- The color of the path (shown when gizmos are active in the Play panel and the tween is running)
-
Tweens a TrailRenderer's startWidth/endWidth to the given value.
Also stores the TrailRenderer as the tween's target so it can be used for filtered operations
@@ -1743,6 +1683,22 @@
Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints
The color of the path (shown when gizmos are active in the Play panel and the tween is running)
+
+ IMPORTANT: Unless you really know what you're doing, you should use the overload that accepts a Vector3 array instead.
+ Tweens a Transform's position via the given path.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The path to use
+ The duration of the tween
+ The path mode: 3D, side-scroller 2D, top-down 2D
+
+
+ IMPORTANT: Unless you really know what you're doing, you should use the overload that accepts a Vector3 array instead.
+ Tweens a Transform's localPosition via the given path.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The path to use
+ The duration of the tween
+ The path mode: 3D, side-scroller 2D, top-down 2D
+
Tweens a Tween's timeScale to the given value.
Also stores the Tween as the tween's target so it can be used for filtered operations
@@ -2523,9 +2479,21 @@
Called when a path tween's current waypoint changes
+
+ Tweeners-only (ignored by Sequences), returns TRUE if the tween was set as relative
+
+
+ FALSE when tween is (or should be) despawned - set only by TweenManager
+
Gets and sets the time position (loops included, delays excluded) of the tween
+
+ TRUE after the tween was set in a play state at least once, AFTER any delay is elapsed
+
+
+ Time position within a single loop cycle
+
Animates a single value
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll
index dd8bf57..7a86edc 100644
Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll differ
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb
index 7e60f1b..25287c6 100644
Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb differ
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll
deleted file mode 100644
index 590ab8e..0000000
Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll and /dev/null differ
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb
deleted file mode 100644
index eb000af..0000000
Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb and /dev/null differ
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb.meta b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb.meta
deleted file mode 100644
index da5d44d..0000000
--- a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 589b8271dd960624a8620bca5ed778db
-timeCreated: 1431691486
-licenseType: Free
-DefaultImporter:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.meta b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.meta
deleted file mode 100644
index e3b9c77..0000000
--- a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.meta
+++ /dev/null
@@ -1,24 +0,0 @@
-fileFormatVersion: 2
-guid: cc98104edfc2736418636b4b8c0e3b0b
-timeCreated: 1431691492
-licenseType: Free
-PluginImporter:
- serializedVersion: 1
- iconMap: {}
- executionOrder: {}
- isPreloaded: 0
- platformData:
- Any:
- enabled: 1
- settings: {}
- Editor:
- enabled: 0
- settings:
- DefaultValueInitialized: true
- WindowsStoreApps:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.xml b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.xml
deleted file mode 100644
index f0efe2b..0000000
--- a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
- DOTween43
-
-
-
-
- Methods that extend known Unity objects and allow to directly create and control tweens from their instances.
- These, as all DOTween43 methods, require Unity 4.3 or later.
-
-
-
- Tweens a Material's color using the given gradient
- (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
- Also stores the image as the tween's target so it can be used for filtered operations
- The gradient to useThe duration of the tween
-
-
- Tweens a Material's named color property using the given gradient
- (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
- Also stores the image as the tween's target so it can be used for filtered operations
- The gradient to use
- The name of the material property to tween (like _Tint or _SpecColor)
- The duration of the tween
-
-
- Tweens a SpriteRenderer's color to the given value.
- Also stores the spriteRenderer as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a Material's alpha color to the given value.
- Also stores the spriteRenderer as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a SpriteRenderer's color using the given gradient
- (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
- Also stores the image as the tween's target so it can be used for filtered operations
- The gradient to useThe duration of the tween
-
-
- Tweens a Rigidbody2D's position to the given value.
- Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Rigidbody2D's X position to the given value.
- Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Rigidbody2D's Y position to the given value.
- Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Rigidbody2D's rotation to the given value.
- Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a Rigidbody2D's position to the given value, while also applying a jump effect along the Y axis.
- Returns a Sequence instead of a Tweener.
- Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations.
- IMPORTANT: a rigidbody2D can't be animated in a jump arc using MovePosition, so the tween will directly set the position
- The end value to reach
- Power of the jump (the max height of the jump is represented by this plus the final Y offset)
- Total number of jumps
- The duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a SpriteRenderer's color to the given value,
- in a way that allows other DOBlendableColor tweens to work together on the same target,
- instead than fight each other as multiple DOColor would do.
- Also stores the SpriteRenderer as the tween's target so it can be used for filtered operations
- The value to tween toThe duration of the tween
-
-
-
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.xml.meta b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.xml.meta
deleted file mode 100644
index 5cddc00..0000000
--- a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween43.xml.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 6e08c600d5d981242b5d3c1d825106d6
-timeCreated: 1431691500
-licenseType: Free
-TextScriptImporter:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll
deleted file mode 100644
index 79daf78..0000000
Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll and /dev/null differ
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb
deleted file mode 100644
index 07e7800..0000000
Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb and /dev/null differ
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.meta b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.meta
deleted file mode 100644
index 5379401..0000000
--- a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.meta
+++ /dev/null
@@ -1,24 +0,0 @@
-fileFormatVersion: 2
-guid: da65c15675bf19f4c953026614098b09
-timeCreated: 1431691492
-licenseType: Free
-PluginImporter:
- serializedVersion: 1
- iconMap: {}
- executionOrder: {}
- isPreloaded: 0
- platformData:
- Any:
- enabled: 1
- settings: {}
- Editor:
- enabled: 0
- settings:
- DefaultValueInitialized: true
- WindowsStoreApps:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.xml b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.xml
deleted file mode 100644
index 4c0ff32..0000000
--- a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.xml
+++ /dev/null
@@ -1,279 +0,0 @@
-
-
-
- DOTween46
-
-
-
-
- Various utils that require Unity 4.6 or later
-
-
-
-
- Converts the anchoredPosition of the first RectTransform to the second RectTransform,
- taking into consideration offset, anchors and pivot, and returns the new anchoredPosition
-
-
-
-
- Methods that extend known Unity objects and allow to directly create and control tweens from their instances.
- These, as all DOTween46 methods, require Unity 4.6 or later.
-
-
-
- Tweens a CanvasGroup's alpha color to the given value.
- Also stores the canvasGroup as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens an Graphic's color to the given value.
- Also stores the image as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens an Graphic's alpha color to the given value.
- Also stores the image as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens an Image's color to the given value.
- Also stores the image as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens an Image's alpha color to the given value.
- Also stores the image as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens an Image's fillAmount to the given value.
- Also stores the image as the tween's target so it can be used for filtered operations
- The end value to reach (0 to 1)The duration of the tween
-
-
- Tweens an Image's colors using the given gradient
- (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
- Also stores the image as the tween's target so it can be used for filtered operations
- The gradient to useThe duration of the tween
-
-
- Tweens an LayoutElement's flexibleWidth/Height to the given value.
- Also stores the LayoutElement as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens an LayoutElement's minWidth/Height to the given value.
- Also stores the LayoutElement as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens an LayoutElement's preferredWidth/Height to the given value.
- Also stores the LayoutElement as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Outline's effectColor to the given value.
- Also stores the Outline as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a Outline's effectColor alpha to the given value.
- Also stores the Outline as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a Outline's effectDistance to the given value.
- Also stores the Outline as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a RectTransform's anchoredPosition to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a RectTransform's anchoredPosition X to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a RectTransform's anchoredPosition Y to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a RectTransform's anchoredPosition3D to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a RectTransform's anchoredPosition3D X to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a RectTransform's anchoredPosition3D Y to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a RectTransform's anchoredPosition3D Z to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a RectTransform's anchorMax to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a RectTransform's anchorMin to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a RectTransform's pivot to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a RectTransform's pivot X to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a RectTransform's pivot Y to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a RectTransform's sizeDelta to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Punches a RectTransform's anchoredPosition towards the given direction and then back to the starting one
- as if it was connected to the starting position via an elastic.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The direction and strength of the punch (added to the RectTransform's current position)
- The duration of the tween
- Indicates how much will the punch vibrate
- Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards.
- 1 creates a full oscillation between the punch direction and the opposite direction,
- while 0 oscillates only between the punch and the start position
- If TRUE the tween will smoothly snap all values to integers
-
-
- 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
- The duration of the tween
- The shake strength
- Indicates how much will the shake vibrate
- 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.
- If TRUE the tween will smoothly snap all values to integers
- If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not
-
-
- 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
- The duration of the tween
- The shake strength on each axis
- Indicates how much will the shake vibrate
- 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.
- If TRUE the tween will smoothly snap all values to integers
- If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not
-
-
- Tweens a RectTransform's anchoredPosition to the given value, while also applying a jump effect along the Y axis.
- Returns a Sequence instead of a Tweener.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reach
- Power of the jump (the max height of the jump is represented by this plus the final Y offset)
- Total number of jumps
- The duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a ScrollRect's horizontal/verticalNormalizedPosition to the given value.
- Also stores the ScrollRect as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a ScrollRect's horizontalNormalizedPosition to the given value.
- Also stores the ScrollRect as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a ScrollRect's verticalNormalizedPosition to the given value.
- Also stores the ScrollRect as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Slider's value to the given value.
- Also stores the Slider as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Text's color to the given value.
- Also stores the Text as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a Text's alpha color to the given value.
- Also stores the Text as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a Text's text to the given value.
- Also stores the Text as the tween's target so it can be used for filtered operations
- The end string to tween toThe duration of the tween
- If TRUE (default), rich text will be interpreted correctly while animated,
- otherwise all tags will be considered as normal text
- The type of scramble mode to use, if any
- 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
-
-
- Tweens a Graphic's color to the given value,
- in a way that allows other DOBlendableColor tweens to work together on the same target,
- instead than fight each other as multiple DOColor would do.
- Also stores the Graphic as the tween's target so it can be used for filtered operations
- The value to tween toThe duration of the tween
-
-
- Tweens a Image's color to the given value,
- in a way that allows other DOBlendableColor tweens to work together on the same target,
- instead than fight each other as multiple DOColor would do.
- Also stores the Image as the tween's target so it can be used for filtered operations
- The value to tween toThe duration of the tween
-
-
- Tweens a Text's color BY the given value,
- in a way that allows other DOBlendableColor tweens to work together on the same target,
- instead than fight each other as multiple DOColor would do.
- Also stores the Text as the tween's target so it can be used for filtered operations
- The value to tween toThe duration of the tween
-
-
-
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.xml.meta b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.xml.meta
deleted file mode 100644
index e9cd763..0000000
--- a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.xml.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: d27835d6231b6aa48841c3f8b2214fa8
-timeCreated: 1431691500
-licenseType: Free
-TextScriptImporter:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll
deleted file mode 100644
index d8acdcd..0000000
Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll and /dev/null differ
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.mdb
deleted file mode 100644
index 47d825a..0000000
Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.mdb and /dev/null differ
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.mdb.meta b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.mdb.meta
deleted file mode 100644
index 93ad7a1..0000000
--- a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.mdb.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 011d3116e0e87e3468e30ecd026d2dbc
-timeCreated: 1431691486
-licenseType: Free
-DefaultImporter:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.meta b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.meta
deleted file mode 100644
index 006af13..0000000
--- a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.meta
+++ /dev/null
@@ -1,24 +0,0 @@
-fileFormatVersion: 2
-guid: a7c56c2a7b6aa7249960e3bdc39b6981
-timeCreated: 1431691491
-licenseType: Free
-PluginImporter:
- serializedVersion: 1
- iconMap: {}
- executionOrder: {}
- isPreloaded: 0
- platformData:
- Any:
- enabled: 1
- settings: {}
- Editor:
- enabled: 0
- settings:
- DefaultValueInitialized: true
- WindowsStoreApps:
- enabled: 0
- settings:
- CPU: AnyCPU
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.xml b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.xml
deleted file mode 100644
index e82f711..0000000
--- a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.xml
+++ /dev/null
@@ -1,163 +0,0 @@
-
-
-
- DOTween50
-
-
-
-
- Methods that extend known Unity objects and allow to directly create and control tweens from their instances.
- These, as all DOTween50 methods, require Unity 5.0 or later.
-
-
-
- Tweens an AudioMixer's exposed float to the given value.
- Also stores the AudioMixer as the tween's target so it can be used for filtered operations.
- Note that you need to manually expose a float in an AudioMixerGroup in order to be able to tween it from an AudioMixer.
- Name given to the exposed float to set
- The end value to reachThe duration of the tween
-
-
-
- Completes all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens completed
- (meaning the tweens that don't have infinite loops and were not already complete)
-
- For Sequences only: if TRUE also internal Sequence callbacks will be fired,
- otherwise they will be ignored
-
-
-
- Kills all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens killed.
-
- If TRUE completes the tween before killing it
-
-
-
- Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens flipped.
-
-
-
-
- Sends to the given position all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens involved.
-
- Time position to reach
- (if higher than the whole tween duration the tween will simply reach its end)
- If TRUE will play the tween after reaching the given position, otherwise it will pause it
-
-
-
- Pauses all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens paused.
-
-
-
-
- Plays all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens played.
-
-
-
-
- Plays backwards all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens played.
-
-
-
-
- Plays forward all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens played.
-
-
-
-
- Restarts all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens restarted.
-
-
-
-
- Rewinds all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens rewinded.
-
-
-
-
- Smoothly rewinds all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens rewinded.
-
-
-
-
- Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens involved.
-
-
-
-
- Methods that extend Tween objects and allow to control or get data from them.
- These require at least Unity 5.3
-
-
-
-
- Returns a that waits until the tween is killed or complete.
- It can be used inside a coroutine as a yield.
- Example usage:yield return myTween.WaitForCompletion(true);
-
-
-
-
- Returns a that waits until the tween is killed or rewinded.
- It can be used inside a coroutine as a yield.
- Example usage:yield return myTween.WaitForRewind();
-
-
-
-
- Returns a that waits until the tween is killed.
- It can be used inside a coroutine as a yield.
- Example usage:yield return myTween.WaitForKill();
-
-
-
-
- Returns a that waits until the tween is killed or has gone through the given amount of loops.
- It can be used inside a coroutine as a yield.
- Example usage:yield return myTween.WaitForElapsedLoops(2);
-
- Elapsed loops to wait for
-
-
-
- Returns a that waits until the tween is killed or has reached the given position (loops included, delays excluded).
- It can be used inside a coroutine as a yield.
- Example usage:yield return myTween.WaitForPosition(2.5f);
-
- Position (loops included, delays excluded) to wait for
-
-
-
- Returns a that waits until the tween is killed or started
- (meaning when the tween is set in a playing state the first time, after any eventual delay).
- It can be used inside a coroutine as a yield.
- Example usage:yield return myTween.WaitForStart();
-
-
-
-
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.xml.meta b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.xml.meta
deleted file mode 100644
index e78bf41..0000000
--- a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween50.xml.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 3a6814e095786e74faa2c054ea887651
-timeCreated: 1431691500
-licenseType: Free
-TextScriptImporter:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML
index 6afe743..6666e3e 100644
--- a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML
@@ -4,37 +4,37 @@
DOTweenEditor
-
+
Checks that the given editor texture use the correct import settings,
and applies them if they're incorrect.
-
+
- Returns TRUE if addons setup is required.
+ Returns TRUE if setup is required
-
+
Returns TRUE if the file/directory at the given path exists.
Path, relative to Unity's project folder
-
+
Converts the given project-relative path to a full path,
with backward (\) slashes).
-
+
Converts the given full path to a path usable with AssetDatabase methods
(relative to Unity's project folder, and with the correct Unity forward (/) slashes).
-
+
Connects to a asset.
If the asset already exists at the given path, loads it and returns it.
@@ -45,21 +45,33 @@
File path (relative to Unity's project folder)
If TRUE and the requested asset doesn't exist, forces its creation
-
+
Full path for the given loaded assembly, assembly file included
-
+
+
+ Adds the given global define if it's not already present
+
+
+
+
+ Removes the given global define if it's present
+
+
+
+
+ Returns TRUE if the given global define is present in all the
+ or only in the given , depending on passed parameters.
+
+
+ to use. Leave NULL to check in all of them.
+
+
Not used as menu item anymore, but as a utiity function
-
-
- Setups DOTween
-
- If TRUE, no warning window appears in case there is no need for setup
-
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll
index abd34df..84a3ac5 100644
Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll and b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll differ
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb
index e0918e3..30eb36c 100644
Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb and b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb differ
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.pdb.meta b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.pdb.meta
deleted file mode 100644
index 7e9a327..0000000
--- a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.pdb.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 22a87305a04c84e40964cdfae301554e
-timeCreated: 1449422216
-licenseType: Free
-DefaultImporter:
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/UnityTests.Unity5/Assets/Demigiant/DemiLib/Core/DemiLib.pdb.meta b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules.meta
similarity index 58%
rename from UnityTests.Unity5/Assets/Demigiant/DemiLib/Core/DemiLib.pdb.meta
rename to UnityTests.Unity5/Assets/Demigiant/DOTween/Modules.meta
index d054dc2..e715e88 100644
--- a/UnityTests.Unity5/Assets/Demigiant/DemiLib/Core/DemiLib.pdb.meta
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules.meta
@@ -1,6 +1,7 @@
fileFormatVersion: 2
-guid: 9bb63fd0cf03cdc4d9e59294bc161dfc
-timeCreated: 1452683141
+guid: c5103b30f7e1e714c82938edde7b7a51
+folderAsset: yes
+timeCreated: 1531821975
licenseType: Pro
DefaultImporter:
userData:
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs
new file mode 100644
index 0000000..c9b77af
--- /dev/null
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs
@@ -0,0 +1,193 @@
+// Author: Daniele Giardini - http://www.demigiant.com
+// Created: 2018/07/13
+
+#if DOTAUDIO
+using System;
+using UnityEngine;
+using UnityEngine.Audio;
+
+#pragma warning disable 1591
+namespace DG.Tweening
+{
+ public static class DOTweenModuleAudio
+ {
+ #region Shortcuts
+
+ #region Audio
+
+ /// Tweens an AudioSource's volume to the given value.
+ /// Also stores the AudioSource as the tween's target so it can be used for filtered operations
+ /// The end value to reach (0 to 1)The duration of the tween
+ public static Tweener DOFade(this AudioSource target, float endValue, float duration)
+ {
+ if (endValue < 0) endValue = 0;
+ else if (endValue > 1) endValue = 1;
+ return DOTween.To(() => target.volume, x => target.volume = x, endValue, duration).SetTarget(target);
+ }
+
+ /// Tweens an AudioSource's pitch to the given value.
+ /// Also stores the AudioSource as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOPitch(this AudioSource target, float endValue, float duration)
+ {
+ return DOTween.To(() => target.pitch, x => target.pitch = x, endValue, duration).SetTarget(target);
+ }
+
+ #endregion
+
+#if UNITY_5 || UNITY_2017_1_OR_NEWER
+ #region AudioMixer (Unity 5 or Newer)
+
+ /// Tweens an AudioMixer's exposed float to the given value.
+ /// Also stores the AudioMixer as the tween's target so it can be used for filtered operations.
+ /// Note that you need to manually expose a float in an AudioMixerGroup in order to be able to tween it from an AudioMixer.
+ /// Name given to the exposed float to set
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOSetFloat(this AudioMixer target, string floatName, float endValue, float duration)
+ {
+ return DOTween.To(()=> {
+ float currVal;
+ target.GetFloat(floatName, out currVal);
+ return currVal;
+ }, x=> target.SetFloat(floatName, x), endValue, duration)
+ .SetTarget(target);
+ }
+
+ #region Operation Shortcuts
+
+ ///
+ /// Completes all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens completed
+ /// (meaning the tweens that don't have infinite loops and were not already complete)
+ ///
+ /// For Sequences only: if TRUE also internal Sequence callbacks will be fired,
+ /// otherwise they will be ignored
+ public static int DOComplete(this AudioMixer target, bool withCallbacks = false)
+ {
+ return DOTween.Complete(target, withCallbacks);
+ }
+
+ ///
+ /// Kills all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens killed.
+ ///
+ /// If TRUE completes the tween before killing it
+ public static int DOKill(this AudioMixer target, bool complete = false)
+ {
+ return DOTween.Kill(target, complete);
+ }
+
+ ///
+ /// Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens flipped.
+ ///
+ public static int DOFlip(this AudioMixer target)
+ {
+ return DOTween.Flip(target);
+ }
+
+ ///
+ /// Sends to the given position all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens involved.
+ ///
+ /// Time position to reach
+ /// (if higher than the whole tween duration the tween will simply reach its end)
+ /// If TRUE will play the tween after reaching the given position, otherwise it will pause it
+ public static int DOGoto(this AudioMixer target, float to, bool andPlay = false)
+ {
+ return DOTween.Goto(target, to, andPlay);
+ }
+
+ ///
+ /// Pauses all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens paused.
+ ///
+ public static int DOPause(this AudioMixer target)
+ {
+ return DOTween.Pause(target);
+ }
+
+ ///
+ /// Plays all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens played.
+ ///
+ public static int DOPlay(this AudioMixer target)
+ {
+ return DOTween.Play(target);
+ }
+
+ ///
+ /// Plays backwards all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens played.
+ ///
+ public static int DOPlayBackwards(this AudioMixer target)
+ {
+ return DOTween.PlayBackwards(target);
+ }
+
+ ///
+ /// Plays forward all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens played.
+ ///
+ public static int DOPlayForward(this AudioMixer target)
+ {
+ return DOTween.PlayForward(target);
+ }
+
+ ///
+ /// Restarts all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens restarted.
+ ///
+ public static int DORestart(this AudioMixer target)
+ {
+ return DOTween.Restart(target);
+ }
+
+ ///
+ /// Rewinds all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens rewinded.
+ ///
+ public static int DORewind(this AudioMixer target)
+ {
+ return DOTween.Rewind(target);
+ }
+
+ ///
+ /// Smoothly rewinds all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens rewinded.
+ ///
+ public static int DOSmoothRewind(this AudioMixer target)
+ {
+ return DOTween.SmoothRewind(target);
+ }
+
+ ///
+ /// Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens involved.
+ ///
+ public static int DOTogglePause(this AudioMixer target)
+ {
+ return DOTween.TogglePause(target);
+ }
+
+ #endregion
+
+ #endregion
+#endif
+
+ #endregion
+ }
+}
+#endif
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs.meta b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs.meta
new file mode 100644
index 0000000..08a8ee7
--- /dev/null
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 0223eae4c5094ed4dbfa04756ed4dd63
+timeCreated: 1531903663
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs
new file mode 100644
index 0000000..dca71a0
--- /dev/null
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs
@@ -0,0 +1,212 @@
+// Author: Daniele Giardini - http://www.demigiant.com
+// Created: 2018/07/13
+
+#if DOTPHYSICS
+using System;
+using DG.Tweening.Core;
+using DG.Tweening.Core.Enums;
+using DG.Tweening.Plugins;
+using DG.Tweening.Plugins.Core.PathCore;
+using DG.Tweening.Plugins.Options;
+using UnityEngine;
+
+#pragma warning disable 1591
+namespace DG.Tweening
+{
+ public static class DOTweenModulePhysics
+ {
+ #region Shortcuts
+
+ #region Rigidbody
+
+ /// Tweens a Rigidbody's position to the given value.
+ /// Also stores the rigidbody as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOMove(this Rigidbody target, Vector3 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.position, target.MovePosition, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ /// Tweens a Rigidbody's X position to the given value.
+ /// Also stores the rigidbody as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOMoveX(this Rigidbody target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue, 0, 0), duration)
+ .SetOptions(AxisConstraint.X, snapping).SetTarget(target);
+ }
+
+ /// Tweens a Rigidbody's Y position to the given value.
+ /// Also stores the rigidbody as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOMoveY(this Rigidbody target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.position, target.MovePosition, new Vector3(0, endValue, 0), duration)
+ .SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
+ }
+
+ /// Tweens a Rigidbody's Z position to the given value.
+ /// Also stores the rigidbody as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOMoveZ(this Rigidbody target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.position, target.MovePosition, new Vector3(0, 0, endValue), duration)
+ .SetOptions(AxisConstraint.Z, snapping).SetTarget(target);
+ }
+
+ /// Tweens a Rigidbody's rotation to the given value.
+ /// Also stores the rigidbody as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// Rotation mode
+ public static Tweener DORotate(this Rigidbody target, Vector3 endValue, float duration, RotateMode mode = RotateMode.Fast)
+ {
+ TweenerCore t = DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration);
+ t.SetTarget(target);
+ t.plugOptions.rotateMode = mode;
+ return t;
+ }
+
+ /// Tweens a Rigidbody's rotation so that it will look towards the given position.
+ /// Also stores the rigidbody as the tween's target so it can be used for filtered operations
+ /// The position to look atThe duration of the tween
+ /// Eventual axis constraint for the rotation
+ /// The vector that defines in which direction up is (default: Vector3.up)
+ public static Tweener DOLookAt(this Rigidbody target, Vector3 towards, float duration, AxisConstraint axisConstraint = AxisConstraint.None, Vector3? up = null)
+ {
+ TweenerCore t = DOTween.To(() => target.rotation, target.MoveRotation, towards, duration)
+ .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetLookAt);
+ t.plugOptions.axisConstraint = axisConstraint;
+ t.plugOptions.up = (up == null) ? Vector3.up : (Vector3)up;
+ return t;
+ }
+
+ #region Special
+
+ /// Tweens a Rigidbody's position to the given value, while also applying a jump effect along the Y axis.
+ /// Returns a Sequence instead of a Tweener.
+ /// Also stores the Rigidbody as the tween's target so it can be used for filtered operations
+ /// The end value to reach
+ /// Power of the jump (the max height of the jump is represented by this plus the final Y offset)
+ /// Total number of jumps
+ /// The duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Sequence DOJump(this Rigidbody target, Vector3 endValue, float jumpPower, int numJumps, float duration, bool snapping = false)
+ {
+ if (numJumps < 1) numJumps = 1;
+ float startPosY = 0;
+ float offsetY = -1;
+ bool offsetYSet = false;
+ Sequence s = DOTween.Sequence();
+ Tween yTween = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, jumpPower, 0), duration / (numJumps * 2))
+ .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative()
+ .SetLoops(numJumps * 2, LoopType.Yoyo)
+ .OnStart(() => startPosY = target.position.y);
+ s.Append(DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue.x, 0, 0), duration)
+ .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
+ ).Join(DOTween.To(() => target.position, target.MovePosition, new Vector3(0, 0, endValue.z), duration)
+ .SetOptions(AxisConstraint.Z, snapping).SetEase(Ease.Linear)
+ ).Join(yTween)
+ .SetTarget(target).SetEase(DOTween.defaultEaseType);
+ yTween.OnUpdate(() => {
+ if (!offsetYSet) {
+ offsetYSet = true;
+ offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
+ }
+ Vector3 pos = target.position;
+ pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad);
+ target.MovePosition(pos);
+ });
+ return s;
+ }
+
+ /// Tweens a Rigidbody's position through the given path waypoints, using the chosen path algorithm.
+ /// Also stores the Rigidbody as the tween's target so it can be used for filtered operations.
+ /// NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.
+ /// BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug).
+ /// If you plan to publish there you should use a regular transform.DOPath.
+ /// The waypoints to go through
+ /// The duration of the tween
+ /// The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)
+ /// The path mode: 3D, side-scroller 2D, top-down 2D
+ /// The resolution of the path (useless in case of Linear paths): higher resolutions make for more detailed curved paths but are more expensive.
+ /// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints
+ /// The color of the path (shown when gizmos are active in the Play panel and the tween is running)
+ public static TweenerCore DOPath(
+ this Rigidbody target, Vector3[] path, float duration, PathType pathType = PathType.Linear,
+ PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null
+ )
+ {
+ if (resolution < 1) resolution = 1;
+ TweenerCore t = DOTween.To(PathPlugin.Get(), () => target.position, target.MovePosition, new Path(pathType, path, resolution, gizmoColor), duration)
+ .SetTarget(target).SetUpdate(UpdateType.Fixed);
+
+ t.plugOptions.isRigidbody = true;
+ t.plugOptions.mode = pathMode;
+ return t;
+ }
+ /// Tweens a Rigidbody's localPosition through the given path waypoints, using the chosen path algorithm.
+ /// Also stores the Rigidbody as the tween's target so it can be used for filtered operations
+ /// NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.
+ /// BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug).
+ /// If you plan to publish there you should use a regular transform.DOLocalPath.
+ /// The waypoint to go through
+ /// The duration of the tween
+ /// The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)
+ /// The path mode: 3D, side-scroller 2D, top-down 2D
+ /// The resolution of the path: higher resolutions make for more detailed curved paths but are more expensive.
+ /// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints
+ /// The color of the path (shown when gizmos are active in the Play panel and the tween is running)
+ public static TweenerCore DOLocalPath(
+ this Rigidbody target, Vector3[] path, float duration, PathType pathType = PathType.Linear,
+ PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null
+ )
+ {
+ if (resolution < 1) resolution = 1;
+ Transform trans = target.transform;
+ TweenerCore t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), new Path(pathType, path, resolution, gizmoColor), duration)
+ .SetTarget(target).SetUpdate(UpdateType.Fixed);
+
+ t.plugOptions.isRigidbody = true;
+ t.plugOptions.mode = pathMode;
+ t.plugOptions.useLocalPosition = true;
+ return t;
+ }
+ // Used by path editor when creating the actual tween, so it can pass a pre-compiled path
+ internal static TweenerCore DOPath(
+ this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D
+ )
+ {
+ TweenerCore t = DOTween.To(PathPlugin.Get(), () => target.position, target.MovePosition, path, duration)
+ .SetTarget(target);
+
+ t.plugOptions.isRigidbody = true;
+ t.plugOptions.mode = pathMode;
+ return t;
+ }
+ internal static TweenerCore DOLocalPath(
+ this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D
+ )
+ {
+ Transform trans = target.transform;
+ TweenerCore t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), path, duration)
+ .SetTarget(target);
+
+ t.plugOptions.isRigidbody = true;
+ t.plugOptions.mode = pathMode;
+ t.plugOptions.useLocalPosition = true;
+ return t;
+ }
+
+ #endregion
+
+ #endregion
+
+ #endregion
+ }
+}
+#endif
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs.meta b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs.meta
new file mode 100644
index 0000000..587bfaa
--- /dev/null
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 3b013f26d887cf94e839b467ef843e07
+timeCreated: 1531903664
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs
new file mode 100644
index 0000000..ba8625f
--- /dev/null
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs
@@ -0,0 +1,101 @@
+// Author: Daniele Giardini - http://www.demigiant.com
+// Created: 2018/07/13
+
+#if DOTPHYSICS2D && (UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER)
+using System;
+using UnityEngine;
+
+#pragma warning disable 1591
+namespace DG.Tweening
+{
+ public static class DOTweenModulePhysics2D
+ {
+ #region Shortcuts
+
+ #region Rigidbody2D Shortcuts
+
+ /// Tweens a Rigidbody2D's position to the given value.
+ /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOMove(this Rigidbody2D target, Vector2 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.position, target.MovePosition, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ /// Tweens a Rigidbody2D's X position to the given value.
+ /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOMoveX(this Rigidbody2D target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.position, target.MovePosition, new Vector2(endValue, 0), duration)
+ .SetOptions(AxisConstraint.X, snapping).SetTarget(target);
+ }
+
+ /// Tweens a Rigidbody2D's Y position to the given value.
+ /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOMoveY(this Rigidbody2D target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.position, target.MovePosition, new Vector2(0, endValue), duration)
+ .SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
+ }
+
+ /// Tweens a Rigidbody2D's rotation to the given value.
+ /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DORotate(this Rigidbody2D target, float endValue, float duration)
+ {
+ return DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration)
+ .SetTarget(target);
+ }
+
+ #region Special
+
+ /// Tweens a Rigidbody2D's position to the given value, while also applying a jump effect along the Y axis.
+ /// Returns a Sequence instead of a Tweener.
+ /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations.
+ /// IMPORTANT: a rigidbody2D can't be animated in a jump arc using MovePosition, so the tween will directly set the position
+ /// The end value to reach
+ /// Power of the jump (the max height of the jump is represented by this plus the final Y offset)
+ /// Total number of jumps
+ /// The duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Sequence DOJump(this Rigidbody2D target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false)
+ {
+ if (numJumps < 1) numJumps = 1;
+ float startPosY = 0;
+ float offsetY = -1;
+ bool offsetYSet = false;
+ Sequence s = DOTween.Sequence();
+ Tween yTween = DOTween.To(() => target.position, x => target.position = x, new Vector2(0, jumpPower), duration / (numJumps * 2))
+ .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative()
+ .SetLoops(numJumps * 2, LoopType.Yoyo)
+ .OnStart(() => startPosY = target.position.y);
+ s.Append(DOTween.To(() => target.position, x => target.position = x, new Vector2(endValue.x, 0), duration)
+ .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
+ ).Join(yTween)
+ .SetTarget(target).SetEase(DOTween.defaultEaseType);
+ yTween.OnUpdate(() => {
+ if (!offsetYSet) {
+ offsetYSet = true;
+ offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
+ }
+ Vector3 pos = target.position;
+ pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad);
+ target.MovePosition(pos);
+ });
+ return s;
+ }
+
+ #endregion
+
+ #endregion
+
+ #endregion
+ }
+}
+#endif
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs.meta b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs.meta
new file mode 100644
index 0000000..a3b9feb
--- /dev/null
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: d023370de51f832488edc0b181cd9e20
+timeCreated: 1531903664
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs
new file mode 100644
index 0000000..21f5d60
--- /dev/null
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs
@@ -0,0 +1,88 @@
+// Author: Daniele Giardini - http://www.demigiant.com
+// Created: 2018/07/13
+
+#if DOTSPRITE && (UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER)
+using System;
+using UnityEngine;
+using DG.Tweening.Core;
+
+#pragma warning disable 1591
+namespace DG.Tweening
+{
+ public static class DOTweenModuleSprite
+ {
+ #region Shortcuts
+
+ #region SpriteRenderer
+
+ /// Tweens a SpriteRenderer's color to the given value.
+ /// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOColor(this SpriteRenderer target, Color endValue, float duration)
+ {
+ return DOTween.To(() => target.color, x => target.color = x, endValue, duration).SetTarget(target);
+ }
+
+ /// Tweens a Material's alpha color to the given value.
+ /// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOFade(this SpriteRenderer target, float endValue, float duration)
+ {
+ return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ /// Tweens a SpriteRenderer's color using the given gradient
+ /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
+ /// Also stores the image as the tween's target so it can be used for filtered operations
+ /// The gradient to useThe duration of the tween
+ public static Sequence DOGradientColor(this SpriteRenderer target, Gradient gradient, float duration)
+ {
+ Sequence s = DOTween.Sequence();
+ GradientColorKey[] colors = gradient.colorKeys;
+ int len = colors.Length;
+ for (int i = 0; i < len; ++i) {
+ GradientColorKey c = colors[i];
+ if (i == 0 && c.time <= 0) {
+ target.color = c.color;
+ continue;
+ }
+ float colorDuration = i == len - 1
+ ? duration - s.Duration(false) // Verifies that total duration is correct
+ : duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
+ s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
+ }
+ return s;
+ }
+
+ #endregion
+
+ #region Blendables
+
+ #region SpriteRenderer
+
+ /// Tweens a SpriteRenderer's color to the given value,
+ /// in a way that allows other DOBlendableColor tweens to work together on the same target,
+ /// instead than fight each other as multiple DOColor would do.
+ /// Also stores the SpriteRenderer as the tween's target so it can be used for filtered operations
+ /// The value to tween toThe duration of the tween
+ public static Tweener DOBlendableColor(this SpriteRenderer target, Color endValue, float duration)
+ {
+ endValue = endValue - target.color;
+ Color to = new Color(0, 0, 0, 0);
+ return DOTween.To(() => to, x => {
+ Color diff = x - to;
+ to = x;
+ target.color += diff;
+ }, endValue, duration)
+ .Blendable().SetTarget(target);
+ }
+
+ #endregion
+
+ #endregion
+
+ #endregion
+ }
+}
+#endif
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs.meta b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs.meta
new file mode 100644
index 0000000..ad4c826
--- /dev/null
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 27bcd8d6727d42c499cdcb2e021873a2
+timeCreated: 1531903663
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUI.cs b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUI.cs
new file mode 100644
index 0000000..de800d5
--- /dev/null
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUI.cs
@@ -0,0 +1,570 @@
+// Author: Daniele Giardini - http://www.demigiant.com
+// Created: 2018/07/13
+
+#if DOTUI && (UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER)
+using System;
+using UnityEngine;
+using UnityEngine.UI;
+using DG.Tweening.Core;
+using DG.Tweening.Core.Enums;
+
+#pragma warning disable 1591
+namespace DG.Tweening
+{
+ public static class DOTweenModuleUI
+ {
+ #region Shortcuts
+
+ #region CanvasGroup
+
+ /// Tweens a CanvasGroup's alpha color to the given value.
+ /// Also stores the canvasGroup as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOFade(this CanvasGroup target, float endValue, float duration)
+ {
+ return DOTween.To(() => target.alpha, x => target.alpha = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ #endregion
+
+ #region Graphic
+
+ /// Tweens an Graphic's color to the given value.
+ /// Also stores the image as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOColor(this Graphic target, Color endValue, float duration)
+ {
+ return DOTween.To(() => target.color, x => target.color = x, endValue, duration).SetTarget(target);
+ }
+
+ /// Tweens an Graphic's alpha color to the given value.
+ /// Also stores the image as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOFade(this Graphic target, float endValue, float duration)
+ {
+ return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ #endregion
+
+ #region Image
+
+ /// Tweens an Image's color to the given value.
+ /// Also stores the image as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOColor(this Image target, Color endValue, float duration)
+ {
+ return DOTween.To(() => target.color, x => target.color = x, endValue, duration).SetTarget(target);
+ }
+
+ /// Tweens an Image's alpha color to the given value.
+ /// Also stores the image as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOFade(this Image target, float endValue, float duration)
+ {
+ return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ /// Tweens an Image's fillAmount to the given value.
+ /// Also stores the image as the tween's target so it can be used for filtered operations
+ /// The end value to reach (0 to 1)The duration of the tween
+ public static Tweener DOFillAmount(this Image target, float endValue, float duration)
+ {
+ if (endValue > 1) endValue = 1;
+ else if (endValue < 0) endValue = 0;
+ return DOTween.To(() => target.fillAmount, x => target.fillAmount = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ /// Tweens an Image's colors using the given gradient
+ /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
+ /// Also stores the image as the tween's target so it can be used for filtered operations
+ /// The gradient to useThe duration of the tween
+ public static Sequence DOGradientColor(this Image target, Gradient gradient, float duration)
+ {
+ Sequence s = DOTween.Sequence();
+ GradientColorKey[] colors = gradient.colorKeys;
+ int len = colors.Length;
+ for (int i = 0; i < len; ++i) {
+ GradientColorKey c = colors[i];
+ if (i == 0 && c.time <= 0) {
+ target.color = c.color;
+ continue;
+ }
+ float colorDuration = i == len - 1
+ ? duration - s.Duration(false) // Verifies that total duration is correct
+ : duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
+ s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
+ }
+ return s;
+ }
+
+ #endregion
+
+ #region LayoutElement
+
+ /// Tweens an LayoutElement's flexibleWidth/Height to the given value.
+ /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOFlexibleSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => new Vector2(target.flexibleWidth, target.flexibleHeight), x => {
+ target.flexibleWidth = x.x;
+ target.flexibleHeight = x.y;
+ }, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ /// Tweens an LayoutElement's minWidth/Height to the given value.
+ /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOMinSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => new Vector2(target.minWidth, target.minHeight), x => {
+ target.minWidth = x.x;
+ target.minHeight = x.y;
+ }, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ /// Tweens an LayoutElement's preferredWidth/Height to the given value.
+ /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOPreferredSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => new Vector2(target.preferredWidth, target.preferredHeight), x => {
+ target.preferredWidth = x.x;
+ target.preferredHeight = x.y;
+ }, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ #endregion
+
+ #region Outline
+
+ /// Tweens a Outline's effectColor to the given value.
+ /// Also stores the Outline as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOColor(this Outline target, Color endValue, float duration)
+ {
+ return DOTween.To(() => target.effectColor, x => target.effectColor = x, endValue, duration).SetTarget(target);
+ }
+
+ /// Tweens a Outline's effectColor alpha to the given value.
+ /// Also stores the Outline as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOFade(this Outline target, float endValue, float duration)
+ {
+ return DOTween.ToAlpha(() => target.effectColor, x => target.effectColor = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ /// Tweens a Outline's effectDistance to the given value.
+ /// Also stores the Outline as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOScale(this Outline target, Vector2 endValue, float duration)
+ {
+ return DOTween.To(() => target.effectDistance, x => target.effectDistance = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ #endregion
+
+ #region RectTransform
+
+ /// Tweens a RectTransform's anchoredPosition to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOAnchorPos(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+ /// Tweens a RectTransform's anchoredPosition X to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOAnchorPosX(this RectTransform target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(endValue, 0), duration)
+ .SetOptions(AxisConstraint.X, snapping).SetTarget(target);
+ }
+ /// Tweens a RectTransform's anchoredPosition Y to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOAnchorPosY(this RectTransform target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(0, endValue), duration)
+ .SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
+ }
+
+ /// Tweens a RectTransform's anchoredPosition3D to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOAnchorPos3D(this RectTransform target, Vector3 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+ /// Tweens a RectTransform's anchoredPosition3D X to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOAnchorPos3DX(this RectTransform target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(endValue, 0, 0), duration)
+ .SetOptions(AxisConstraint.X, snapping).SetTarget(target);
+ }
+ /// Tweens a RectTransform's anchoredPosition3D Y to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOAnchorPos3DY(this RectTransform target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(0, endValue, 0), duration)
+ .SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
+ }
+ /// Tweens a RectTransform's anchoredPosition3D Z to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOAnchorPos3DZ(this RectTransform target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(0, 0, endValue), duration)
+ .SetOptions(AxisConstraint.Z, snapping).SetTarget(target);
+ }
+
+ /// Tweens a RectTransform's anchorMax to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOAnchorMax(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.anchorMax, x => target.anchorMax = x, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ /// Tweens a RectTransform's anchorMin to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOAnchorMin(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.anchorMin, x => target.anchorMin = x, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ /// Tweens a RectTransform's pivot to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOPivot(this RectTransform target, Vector2 endValue, float duration)
+ {
+ return DOTween.To(() => target.pivot, x => target.pivot = x, endValue, duration)
+ .SetTarget(target);
+ }
+ /// Tweens a RectTransform's pivot X to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOPivotX(this RectTransform target, float endValue, float duration)
+ {
+ return DOTween.To(() => target.pivot, x => target.pivot = x, new Vector2(endValue, 0), duration)
+ .SetOptions(AxisConstraint.X).SetTarget(target);
+ }
+ /// Tweens a RectTransform's pivot Y to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOPivotY(this RectTransform target, float endValue, float duration)
+ {
+ return DOTween.To(() => target.pivot, x => target.pivot = x, new Vector2(0, endValue), duration)
+ .SetOptions(AxisConstraint.Y).SetTarget(target);
+ }
+
+ /// Tweens a RectTransform's sizeDelta to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOSizeDelta(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.sizeDelta, x => target.sizeDelta = x, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ /// Punches a RectTransform's anchoredPosition towards the given direction and then back to the starting one
+ /// as if it was connected to the starting position via an elastic.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The direction and strength of the punch (added to the RectTransform's current position)
+ /// The duration of the tween
+ /// Indicates how much will the punch vibrate
+ /// Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards.
+ /// 1 creates a full oscillation between the punch direction and the opposite direction,
+ /// while 0 oscillates only between the punch and the start position
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOPunchAnchorPos(this RectTransform target, Vector2 punch, float duration, int vibrato = 10, float elasticity = 1, bool snapping = false)
+ {
+ return DOTween.Punch(() => target.anchoredPosition, x => target.anchoredPosition = x, punch, duration, vibrato, elasticity)
+ .SetTarget(target).SetOptions(snapping);
+ }
+
+ /// 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
+ /// The duration of the tween
+ /// The shake strength
+ /// Indicates how much will the shake vibrate
+ /// 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.
+ /// If TRUE the tween will smoothly snap all values to integers
+ /// If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not
+ public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, float strength = 100, 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, true, fadeOut)
+ .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping);
+ }
+ /// 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
+ /// The duration of the tween
+ /// The shake strength on each axis
+ /// Indicates how much will the shake vibrate
+ /// 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.
+ /// If TRUE the tween will smoothly snap all values to integers
+ /// If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not
+ 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);
+ }
+
+ #region Special
+
+ /// Tweens a RectTransform's anchoredPosition to the given value, while also applying a jump effect along the Y axis.
+ /// Returns a Sequence instead of a Tweener.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reach
+ /// Power of the jump (the max height of the jump is represented by this plus the final Y offset)
+ /// Total number of jumps
+ /// The duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Sequence DOJumpAnchorPos(this RectTransform target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false)
+ {
+ if (numJumps < 1) numJumps = 1;
+ float startPosY = 0;
+ float offsetY = -1;
+ bool offsetYSet = false;
+
+ // Separate Y Tween so we can elaborate elapsedPercentage on that insted of on the Sequence
+ // (in case users add a delay or other elements to the Sequence)
+ Sequence s = DOTween.Sequence();
+ Tween yTween = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(0, jumpPower), duration / (numJumps * 2))
+ .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative()
+ .SetLoops(numJumps * 2, LoopType.Yoyo)
+ .OnStart(()=> startPosY = target.anchoredPosition.y);
+ s.Append(DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(endValue.x, 0), duration)
+ .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
+ ).Join(yTween)
+ .SetTarget(target).SetEase(DOTween.defaultEaseType);
+ s.OnUpdate(() => {
+ if (!offsetYSet) {
+ offsetYSet = true;
+ offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
+ }
+ Vector2 pos = target.anchoredPosition;
+ pos.y += DOVirtual.EasedValue(0, offsetY, s.ElapsedDirectionalPercentage(), Ease.OutQuad);
+ target.anchoredPosition = pos;
+ });
+ return s;
+ }
+
+ #endregion
+
+ #endregion
+
+ #region ScrollRect
+
+ /// Tweens a ScrollRect's horizontal/verticalNormalizedPosition to the given value.
+ /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DONormalizedPos(this ScrollRect target, Vector2 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => new Vector2(target.horizontalNormalizedPosition, target.verticalNormalizedPosition),
+ x => {
+ target.horizontalNormalizedPosition = x.x;
+ target.verticalNormalizedPosition = x.y;
+ }, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+ /// Tweens a ScrollRect's horizontalNormalizedPosition to the given value.
+ /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOHorizontalNormalizedPos(this ScrollRect target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.horizontalNormalizedPosition, x => target.horizontalNormalizedPosition = x, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+ /// Tweens a ScrollRect's verticalNormalizedPosition to the given value.
+ /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOVerticalNormalizedPos(this ScrollRect target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.verticalNormalizedPosition, x => target.verticalNormalizedPosition = x, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ #endregion
+
+ #region Slider
+
+ /// Tweens a Slider's value to the given value.
+ /// Also stores the Slider as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOValue(this Slider target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.value, x => target.value = x, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ #endregion
+
+ #region Text
+
+ /// Tweens a Text's color to the given value.
+ /// Also stores the Text as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOColor(this Text target, Color endValue, float duration)
+ {
+ return DOTween.To(() => target.color, x => target.color = x, endValue, duration).SetTarget(target);
+ }
+
+ /// Tweens a Text's alpha color to the given value.
+ /// Also stores the Text as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOFade(this Text target, float endValue, float duration)
+ {
+ return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ /// Tweens a Text's text to the given value.
+ /// Also stores the Text as the tween's target so it can be used for filtered operations
+ /// The end string to tween toThe duration of the tween
+ /// If TRUE (default), rich text will be interpreted correctly while animated,
+ /// otherwise all tags will be considered as normal text
+ /// The type of scramble mode to use, if any
+ /// 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
+ public static Tweener DOText(this Text 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
+
+ #region Blendables
+
+ #region Graphic
+
+ /// Tweens a Graphic's color to the given value,
+ /// in a way that allows other DOBlendableColor tweens to work together on the same target,
+ /// instead than fight each other as multiple DOColor would do.
+ /// Also stores the Graphic as the tween's target so it can be used for filtered operations
+ /// The value to tween toThe duration of the tween
+ public static Tweener DOBlendableColor(this Graphic target, Color endValue, float duration)
+ {
+ endValue = endValue - target.color;
+ Color to = new Color(0, 0, 0, 0);
+ return DOTween.To(() => to, x => {
+ Color diff = x - to;
+ to = x;
+ target.color += diff;
+ }, endValue, duration)
+ .Blendable().SetTarget(target);
+ }
+
+ #endregion
+
+ #region Image
+
+ /// Tweens a Image's color to the given value,
+ /// in a way that allows other DOBlendableColor tweens to work together on the same target,
+ /// instead than fight each other as multiple DOColor would do.
+ /// Also stores the Image as the tween's target so it can be used for filtered operations
+ /// The value to tween toThe duration of the tween
+ public static Tweener DOBlendableColor(this Image target, Color endValue, float duration)
+ {
+ endValue = endValue - target.color;
+ Color to = new Color(0, 0, 0, 0);
+ return DOTween.To(() => to, x => {
+ Color diff = x - to;
+ to = x;
+ target.color += diff;
+ }, endValue, duration)
+ .Blendable().SetTarget(target);
+ }
+
+ #endregion
+
+ #region Text
+
+ /// Tweens a Text's color BY the given value,
+ /// in a way that allows other DOBlendableColor tweens to work together on the same target,
+ /// instead than fight each other as multiple DOColor would do.
+ /// Also stores the Text as the tween's target so it can be used for filtered operations
+ /// The value to tween toThe duration of the tween
+ public static Tweener DOBlendableColor(this Text target, Color endValue, float duration)
+ {
+ endValue = endValue - target.color;
+ Color to = new Color(0, 0, 0, 0);
+ return DOTween.To(() => to, x => {
+ Color diff = x - to;
+ to = x;
+ target.color += diff;
+ }, endValue, duration)
+ .Blendable().SetTarget(target);
+ }
+
+ #endregion
+
+ #endregion
+
+ #endregion
+
+ // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
+ // ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████
+ // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
+
+ public static class Utils
+ {
+ ///
+ /// Converts the anchoredPosition of the first RectTransform to the second RectTransform,
+ /// taking into consideration offset, anchors and pivot, and returns the new anchoredPosition
+ ///
+ public static Vector2 SwitchToRectTransform(RectTransform from, RectTransform to)
+ {
+ Vector2 localPoint;
+ Vector2 fromPivotDerivedOffset = new Vector2(from.rect.width * 0.5f + from.rect.xMin, from.rect.height * 0.5f + from.rect.yMin);
+ Vector2 screenP = RectTransformUtility.WorldToScreenPoint(null, from.position);
+ screenP += fromPivotDerivedOffset;
+ RectTransformUtility.ScreenPointToLocalPointInRectangle(to, screenP, null, out localPoint);
+ Vector2 pivotDerivedOffset = new Vector2(to.rect.width * 0.5f + to.rect.xMin, to.rect.height * 0.5f + to.rect.yMin);
+ return to.anchoredPosition + localPoint - pivotDerivedOffset;
+ }
+ }
+ }
+}
+#endif
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUI.cs.meta b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUI.cs.meta
new file mode 100644
index 0000000..f10970a
--- /dev/null
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUI.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: dd744f5b62ad0fb4391fa4499a84a8c0
+timeCreated: 1531903664
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs
new file mode 100644
index 0000000..751a0a7
--- /dev/null
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs
@@ -0,0 +1,252 @@
+// Author: Daniele Giardini - http://www.demigiant.com
+// Created: 2018/07/13
+
+using System;
+using UnityEngine;
+using DG.Tweening.Core;
+
+#pragma warning disable 1591
+namespace DG.Tweening
+{
+ ///
+ /// Shortcuts/functions that are not strictly related to specific Modules
+ /// but are available only on some Unity versions
+ ///
+ public static class DOTweenModuleUnityVersion
+ {
+#if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER
+ #region Unity 4.3 or Newer
+
+ #region Material
+
+ /// Tweens a Material's color using the given gradient
+ /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
+ /// Also stores the image as the tween's target so it can be used for filtered operations
+ /// The gradient to useThe duration of the tween
+ public static Sequence DOGradientColor(this Material target, Gradient gradient, float duration)
+ {
+ Sequence s = DOTween.Sequence();
+ GradientColorKey[] colors = gradient.colorKeys;
+ int len = colors.Length;
+ for (int i = 0; i < len; ++i) {
+ GradientColorKey c = colors[i];
+ if (i == 0 && c.time <= 0) {
+ target.color = c.color;
+ continue;
+ }
+ float colorDuration = i == len - 1
+ ? duration - s.Duration(false) // Verifies that total duration is correct
+ : duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
+ s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
+ }
+ return s;
+ }
+ /// Tweens a Material's named color property using the given gradient
+ /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
+ /// Also stores the image as the tween's target so it can be used for filtered operations
+ /// The gradient to use
+ /// The name of the material property to tween (like _Tint or _SpecColor)
+ /// The duration of the tween
+ public static Sequence DOGradientColor(this Material target, Gradient gradient, string property, float duration)
+ {
+ Sequence s = DOTween.Sequence();
+ GradientColorKey[] colors = gradient.colorKeys;
+ int len = colors.Length;
+ for (int i = 0; i < len; ++i) {
+ GradientColorKey c = colors[i];
+ if (i == 0 && c.time <= 0) {
+ target.color = c.color;
+ continue;
+ }
+ float colorDuration = i == len - 1
+ ? duration - s.Duration(false) // Verifies that total duration is correct
+ : duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
+ s.Append(target.DOColor(c.color, property, colorDuration).SetEase(Ease.Linear));
+ }
+ return s;
+ }
+
+ #endregion
+
+ #endregion
+#endif
+
+#if UNITY_5_3_OR_NEWER || UNITY_2017_1_OR_NEWER
+ #region CustomYieldInstructions (Unity 5.3 or Newer)
+
+ ///
+ /// Returns a that waits until the tween is killed or complete.
+ /// It can be used inside a coroutine as a yield.
+ /// Example usage:yield return myTween.WaitForCompletion(true);
+ ///
+ public static CustomYieldInstruction WaitForCompletion(this Tween t, bool returnCustomYieldInstruction)
+ {
+ if (!t.active) {
+ if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
+ return null;
+ }
+ return new DOTweenCYInstruction.WaitForCompletion(t);
+ }
+
+ ///
+ /// Returns a that waits until the tween is killed or rewinded.
+ /// It can be used inside a coroutine as a yield.
+ /// Example usage:yield return myTween.WaitForRewind();
+ ///
+ public static CustomYieldInstruction WaitForRewind(this Tween t, bool returnCustomYieldInstruction)
+ {
+ if (!t.active) {
+ if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
+ return null;
+ }
+ return new DOTweenCYInstruction.WaitForRewind(t);
+ }
+
+ ///
+ /// Returns a that waits until the tween is killed.
+ /// It can be used inside a coroutine as a yield.
+ /// Example usage:yield return myTween.WaitForKill();
+ ///
+ public static CustomYieldInstruction WaitForKill(this Tween t, bool returnCustomYieldInstruction)
+ {
+ if (!t.active) {
+ if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
+ return null;
+ }
+ return new DOTweenCYInstruction.WaitForKill(t);
+ }
+
+ ///
+ /// Returns a that waits until the tween is killed or has gone through the given amount of loops.
+ /// It can be used inside a coroutine as a yield.
+ /// Example usage:yield return myTween.WaitForElapsedLoops(2);
+ ///
+ /// Elapsed loops to wait for
+ public static CustomYieldInstruction WaitForElapsedLoops(this Tween t, int elapsedLoops, bool returnCustomYieldInstruction)
+ {
+ if (!t.active) {
+ if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
+ return null;
+ }
+ return new DOTweenCYInstruction.WaitForElapsedLoops(t, elapsedLoops);
+ }
+
+ ///
+ /// Returns a that waits until the tween is killed or has reached the given position (loops included, delays excluded).
+ /// It can be used inside a coroutine as a yield.
+ /// Example usage:yield return myTween.WaitForPosition(2.5f);
+ ///
+ /// Position (loops included, delays excluded) to wait for
+ public static CustomYieldInstruction WaitForPosition(this Tween t, float position, bool returnCustomYieldInstruction)
+ {
+ if (!t.active) {
+ if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
+ return null;
+ }
+ return new DOTweenCYInstruction.WaitForPosition(t, position);
+ }
+
+ ///
+ /// Returns a that waits until the tween is killed or started
+ /// (meaning when the tween is set in a playing state the first time, after any eventual delay).
+ /// It can be used inside a coroutine as a yield.
+ /// Example usage:yield return myTween.WaitForStart();
+ ///
+ public static CustomYieldInstruction WaitForStart(this Tween t, bool returnCustomYieldInstruction)
+ {
+ if (!t.active) {
+ if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
+ return null;
+ }
+ return new DOTweenCYInstruction.WaitForStart(t);
+ }
+
+ #endregion
+#endif
+ }
+
+ // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
+ // ███ CLASSES █████████████████████████████████████████████████████████████████████████████████████████████████████████
+ // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
+
+#if UNITY_5_3_OR_NEWER || UNITY_2017_1_OR_NEWER
+ public static class DOTweenCYInstruction
+ {
+ public class WaitForCompletion : CustomYieldInstruction
+ {
+ public override bool keepWaiting { get {
+ return t.active && !t.IsComplete();
+ }}
+ readonly Tween t;
+ public WaitForCompletion(Tween tween)
+ {
+ t = tween;
+ }
+ }
+
+ public class WaitForRewind : CustomYieldInstruction
+ {
+ public override bool keepWaiting { get {
+ return t.active && (!t.playedOnce || t.position * (t.CompletedLoops() + 1) > 0);
+ }}
+ readonly Tween t;
+ public WaitForRewind(Tween tween)
+ {
+ t = tween;
+ }
+ }
+
+ public class WaitForKill : CustomYieldInstruction
+ {
+ public override bool keepWaiting { get {
+ return t.active;
+ }}
+ readonly Tween t;
+ public WaitForKill(Tween tween)
+ {
+ t = tween;
+ }
+ }
+
+ public class WaitForElapsedLoops : CustomYieldInstruction
+ {
+ public override bool keepWaiting { get {
+ return t.active && t.CompletedLoops() < elapsedLoops;
+ }}
+ readonly Tween t;
+ readonly int elapsedLoops;
+ public WaitForElapsedLoops(Tween tween, int elapsedLoops)
+ {
+ t = tween;
+ this.elapsedLoops = elapsedLoops;
+ }
+ }
+
+ public class WaitForPosition : CustomYieldInstruction
+ {
+ public override bool keepWaiting { get {
+ return t.active && t.position * (t.CompletedLoops() + 1) < position;
+ }}
+ readonly Tween t;
+ readonly float position;
+ public WaitForPosition(Tween tween, float position)
+ {
+ t = tween;
+ this.position = position;
+ }
+ }
+
+ public class WaitForStart : CustomYieldInstruction
+ {
+ public override bool keepWaiting { get {
+ return t.active && !t.playedOnce;
+ }}
+ readonly Tween t;
+ public WaitForStart(Tween tween)
+ {
+ t = tween;
+ }
+ }
+ }
+#endif
+}
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs.meta b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs.meta
new file mode 100644
index 0000000..e1bf18b
--- /dev/null
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 39df9327575994a4fa959ed9a97a1e5e
+timeCreated: 1531903664
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs
new file mode 100644
index 0000000..a768721
--- /dev/null
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs
@@ -0,0 +1,108 @@
+// Author: Daniele Giardini - http://www.demigiant.com
+// Created: 2018/07/13
+
+using System;
+using UnityEngine;
+using DG.Tweening.Core;
+using DG.Tweening.Plugins.Core.PathCore;
+using DG.Tweening.Plugins.Options;
+
+#pragma warning disable 1591
+namespace DG.Tweening
+{
+ ///
+ /// Utility functions that deal with available Modules.
+ /// Modules defines:
+ /// - DOTAUDIO
+ /// - DOTPHYSICS
+ /// - DOTPHYSICS2D
+ /// - DOTSPRITE
+ /// - DOTUI
+ /// Extra defines set and used for implementation of external assets:
+ /// - DOTWEEN_TMP ► TextMesh Pro
+ /// - DOTWEEN_TK2D ► 2D Toolkit
+ ///
+ public static class DOTweenModuleUtils
+ {
+ static bool _initialized;
+
+ ///
+ /// Called via Reflection by DOTweenComponent on Awake
+ ///
+ public static void Init()
+ {
+ if (_initialized) return;
+
+ _initialized = true;
+ DOTweenExternalCommand.SetOrientationOnPath += Physics.SetOrientationOnPath;
+ }
+
+ // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
+ // ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████
+ // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
+
+ public static class Physics
+ {
+ // Called via DOTweenExternalCommand callback
+ public static void SetOrientationOnPath(PathOptions options, Tween t, Quaternion newRot, Transform trans)
+ {
+#if DOTPHYSICS
+ if (options.isRigidbody) ((Rigidbody)t.target).rotation = newRot;
+ else trans.rotation = newRot;
+#else
+ trans.rotation = newRot;
+#endif
+ }
+
+ // Returns FALSE if the DOTween's Physics2D Module is disabled, or if there's no Rigidbody2D attached
+ public static bool HasRigidbody2D(Component target)
+ {
+#if DOTPHYSICS2D
+ return target.GetComponent() != null;
+#else
+ return false;
+#endif
+ }
+
+ #region Called via Reflection
+
+
+ // Called via Reflection by DOTweenPathInspector
+ // Returns FALSE if the DOTween's Physics Module is disabled, or if there's no rigidbody attached
+ public static bool HasRigidbody(Component target)
+ {
+#if DOTPHYSICS
+ return target.GetComponent() != null;
+#else
+ return false;
+#endif
+ }
+
+ // Called via Reflection by DOTweenPath
+ public static TweenerCore CreateDOTweenPathTween(
+ MonoBehaviour target, bool tweenRigidbody, bool isLocal, Path path, float duration, PathMode pathMode
+ ){
+ TweenerCore t;
+#if DOTPHYSICS
+ Rigidbody rBody = tweenRigidbody ? target.GetComponent() : null;
+ if (tweenRigidbody && rBody != null) {
+ t = isLocal
+ ? rBody.DOLocalPath(path, duration, pathMode)
+ : rBody.DOPath(path, duration, pathMode);
+ } else {
+ t = isLocal
+ ? target.transform.DOLocalPath(path, duration, pathMode)
+ : target.transform.DOPath(path, duration, pathMode);
+ }
+#else
+ t = isLocal
+ ? target.transform.DOLocalPath(path, duration, pathMode)
+ : target.transform.DOPath(path, duration, pathMode);
+#endif
+ return t;
+ }
+
+ #endregion
+ }
+ }
+}
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs.meta b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs.meta
new file mode 100644
index 0000000..42f8631
--- /dev/null
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 3fcddc0756073fd4aa84610b570ca6f9
+timeCreated: 1531903664
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/readme.txt b/UnityTests.Unity5/Assets/Demigiant/DOTween/readme.txt
index 3439db1..aa60e6f 100644
--- a/UnityTests.Unity5/Assets/Demigiant/DOTween/readme.txt
+++ b/UnityTests.Unity5/Assets/Demigiant/DOTween/readme.txt
@@ -1,8 +1,17 @@
DOTween and DOTween Pro are copyright (c) 2014 Daniele Giardini - Demigiant
+// IMPORTANT!!! /////////////////////////////////////////////
+// Upgrading DOTween from versions older than 1.2.000 ///////
+-------------------------------------------------------------
+If you're upgrading your project from a version of DOTween older than 1.2.000 (or DOTween Pro older than 1.0.000) please follow these instructions carefully.
+1) Import the new version in the same folder as the previous one, overwriting old files. A lot of errors will appear but don't worry
+2) Close and reopen Unity (and your project). This is fundamental: skipping this step will cause a bloodbath
+3) Open DOTween's Utility Panel (Tools > Demigiant > DOTween Utility Panel) if it doesn't open automatically, then press "Setup DOTween...": this will run the upgrade setup
+4) From the Add/Remove Modules panel that opens, activate all Modules for the tweens you were using (all of them, probably)
+
// GET STARTED //////////////////////////////////////////////
-- After importing a new DOTween update, select DOTween's Utility Panel from the Tools menu (if it doesn't open automatically) and press the "Setup DOTween..." button to set up additional features based on your Unity version.
+- After importing a new DOTween update, select DOTween's Utility Panel from the "Tools/Demigiant" menu (if it doesn't open automatically) and press the "Setup DOTween..." button to activate/deactivate Modules. You can also access a Preferences Tab from there to choose default settings for DOTween.
- In your code, add "using DG.Tweening" to each class where you want to use DOTween.
- You're ready to tween. Check out the links below for full documentation and license info.
@@ -12,7 +21,8 @@ DOTween and DOTween Pro are copyright (c) 2014 Daniele Giardini - Demigiant
DOTween website (documentation, examples, etc): http://dotween.demigiant.com
DOTween license: http://dotween.demigiant.com/license.php
DOTween repository (Google Code): https://code.google.com/p/dotween/
+Demigiant website (documentation, examples, etc): http://www.demigiant.com
// NOTES //////////////////////////////////////////////////////
-- DOTween's Utility Panel can be found under "Tools > DOTween Utility Panel" and also contains other useful options, plus a tab to set DOTween's preferences
\ No newline at end of file
+- DOTween's Utility Panel can be found under "Tools > Demigiant > DOTween Utility Panel" and also contains other useful options, plus a tab to set DOTween's preferences
\ No newline at end of file
diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb.meta b/UnityTests.Unity5/Assets/Demigiant/DemiLib/Core/Editor/Imgs/project.meta
similarity index 53%
rename from UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb.meta
rename to UnityTests.Unity5/Assets/Demigiant/DemiLib/Core/Editor/Imgs/project.meta
index 3ca948a..3f2cd9d 100644
--- a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb.meta
+++ b/UnityTests.Unity5/Assets/Demigiant/DemiLib/Core/Editor/Imgs/project.meta
@@ -1,7 +1,6 @@
fileFormatVersion: 2
-guid: 773153d471589be45acb355405a2bcf5
-timeCreated: 1431691486
-licenseType: Free
+guid: 1fa36039328c18e48808faaf6a351f48
+folderAsset: yes
DefaultImporter:
userData:
assetBundleName:
diff --git a/UnityTests.Unity5/Assets/ExternalPluginsStubs/TextMeshProStubs.cs b/UnityTests.Unity5/Assets/ExternalPluginsStubs/TextMeshProStubs.cs
index c3cf851..2e04404 100644
--- a/UnityTests.Unity5/Assets/ExternalPluginsStubs/TextMeshProStubs.cs
+++ b/UnityTests.Unity5/Assets/ExternalPluginsStubs/TextMeshProStubs.cs
@@ -2,21 +2,22 @@
namespace TMPro
{
- public class TextMeshPro : MonoBehaviour
+ public class TMP_Text : MonoBehaviour
+ {
+ public Color color, outlineColor, faceColor;
+ public Material fontMaterial, fontSharedMaterial;
+ public float fontSize;
+ public int maxVisibleCharacters;
+ public string text;
+ }
+
+ public class TextMeshPro : TMP_Text
{
- public Color color, outlineColor, faceColor;
- public Material fontMaterial, fontSharedMaterial;
- public float fontSize;
- public int maxVisibleCharacters;
- public string text;
+
}
- public class TextMeshProUGUI : MonoBehaviour
+ public class TextMeshProUGUI : TMP_Text
{
- public Color color, outlineColor, faceColor;
- public Material fontMaterial, fontSharedMaterial;
- public float fontSize;
- public int maxVisibleCharacters;
- public string text;
+
}
}
\ No newline at end of file
diff --git a/UnityTests.Unity5/Assets/_Tests/CustomYieldInstructions.cs b/UnityTests.Unity5/Assets/_Tests/CustomYieldInstructions.cs
index 1bc892a..8a696d6 100644
--- a/UnityTests.Unity5/Assets/_Tests/CustomYieldInstructions.cs
+++ b/UnityTests.Unity5/Assets/_Tests/CustomYieldInstructions.cs
@@ -1,7 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
-using DG.Tweening.CustomYieldInstructions;
using UnityEngine;
public class CustomYieldInstructions : BrainBase
diff --git a/UnityTests.Unity5/Assets/_Tests/RectTransformConversionTests.cs b/UnityTests.Unity5/Assets/_Tests/RectTransformConversionTests.cs
index 54d710a..29d7d3e 100644
--- a/UnityTests.Unity5/Assets/_Tests/RectTransformConversionTests.cs
+++ b/UnityTests.Unity5/Assets/_Tests/RectTransformConversionTests.cs
@@ -33,7 +33,7 @@ public class RectTransformConversionTests : BrainBase
Vector2 bPivotDerivedOffset = new Vector2(b.rect.width * 0.5f + b.rect.xMin, b.rect.height * 0.5f + b.rect.yMin);
Debug.Log(bPivotDerivedOffset);
b.anchoredPosition = b.anchoredPosition + localPoint - bPivotDerivedOffset;
- Debug.Log(b.anchoredPosition + " - " + DOTweenUtils46.SwitchToRectTransform(a, b));
+// Debug.Log(b.anchoredPosition + " - " + DOTweenUtils46.SwitchToRectTransform(a, b));
}
string ArrayToString(IList list)
diff --git a/UnityTests.Unity5/Assets/_Tests/TempTests.cs b/UnityTests.Unity5/Assets/_Tests/TempTests.cs
index 7125b2c..6b330d5 100644
--- a/UnityTests.Unity5/Assets/_Tests/TempTests.cs
+++ b/UnityTests.Unity5/Assets/_Tests/TempTests.cs
@@ -11,25 +11,17 @@ using UnityEngine.UI;
public class TempTests : BrainBase
{
- public Image target;
+ public Transform target0;
+ public Transform target1;
IEnumerator Start()
{
- Sequence _passenger_arrow_out = DOTween.Sequence();
- _passenger_arrow_out.Insert(0, target.GetComponent().DOAnchorPos(new Vector2(300f, 26f), 1f));
- _passenger_arrow_out.Insert(0, target.DOFade(0f, 0.8f));
- _passenger_arrow_out.SetAutoKill(false);
- _passenger_arrow_out.Pause();
-
- Sequence _passenger_arrow_in = DOTween.Sequence();
- _passenger_arrow_in.Insert(0, target.GetComponent().DOAnchorPos(new Vector2(-200f, 26f), 1f));
- _passenger_arrow_in.Insert(0, target.DOFade(1f, 0.8f));
- _passenger_arrow_in.SetAutoKill(false);
- _passenger_arrow_in.Pause();
+ Tween t0 = target0.DOBlendableLocalMoveBy(new Vector3(1, 2, 1), 2f);
+ Tween t1 = target1.DOBlendableLocalMoveBy(new Vector3(1, -2, 1), 2f);
yield return new WaitForSeconds(1);
- _passenger_arrow_out.Rewind();
- _passenger_arrow_out.PlayForward();
+ t0.Kill();
+ t1.Goto(1.5f);
}
}
\ No newline at end of file
diff --git a/UnityTests.Unity5/Assets/_Tests/TempTests.unity b/UnityTests.Unity5/Assets/_Tests/TempTests.unity
index c21d4fd..87a4f89 100644
Binary files a/UnityTests.Unity5/Assets/_Tests/TempTests.unity and b/UnityTests.Unity5/Assets/_Tests/TempTests.unity differ
diff --git a/UnityTests.Unity5/ProjectSettings/ProjectSettings.asset b/UnityTests.Unity5/ProjectSettings/ProjectSettings.asset
index 336425d..4ceded1 100644
Binary files a/UnityTests.Unity5/ProjectSettings/ProjectSettings.asset and b/UnityTests.Unity5/ProjectSettings/ProjectSettings.asset differ
diff --git a/_DOTween.Assembly/DOTween.sln b/_DOTween.Assembly/DOTween.sln
index 9a5fab8..5518894 100644
--- a/_DOTween.Assembly/DOTween.sln
+++ b/_DOTween.Assembly/DOTween.sln
@@ -17,10 +17,20 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DOTween46", "DOTween46\DOTw
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DOTween50", "DOTween50\DOTween50.csproj", "{930C3B07-B00A-44B8-A8E5-452A8FD125C7}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DOTween_LooseScripts", "DOTween_LooseScripts\DOTween_LooseScripts.csproj", "{0B529A90-0B97-4840-BEB6-4A6700B46655}"
+ ProjectSection(ProjectDependencies) = postProject
+ {DE17C145-3E8D-45D6-BBB6-D06BD7D80A55} = {DE17C145-3E8D-45D6-BBB6-D06BD7D80A55}
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Legacy_NoModules", "Legacy_NoModules", "{3945F2EC-EA44-45DF-82B5-33E978AE8345}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DOTweenUpgradeManager", "DOTweenUpgradeManager\DOTweenUpgradeManager.csproj", "{6BC7290B-999D-4688-959C-868306C1F52B}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
CompatibilityMode|Any CPU = CompatibilityMode|Any CPU
Debug|Any CPU = Debug|Any CPU
+ Release_IncludeRigidbody|Any CPU = Release_IncludeRigidbody|Any CPU
Release_NoRigidbody|Any CPU = Release_NoRigidbody|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
@@ -29,6 +39,8 @@ Global
{DE17C145-3E8D-45D6-BBB6-D06BD7D80A55}.CompatibilityMode|Any CPU.Build.0 = CompatibilityMode|Any CPU
{DE17C145-3E8D-45D6-BBB6-D06BD7D80A55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE17C145-3E8D-45D6-BBB6-D06BD7D80A55}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DE17C145-3E8D-45D6-BBB6-D06BD7D80A55}.Release_IncludeRigidbody|Any CPU.ActiveCfg = Release_IncludeRigidbody|Any CPU
+ {DE17C145-3E8D-45D6-BBB6-D06BD7D80A55}.Release_IncludeRigidbody|Any CPU.Build.0 = Release_IncludeRigidbody|Any CPU
{DE17C145-3E8D-45D6-BBB6-D06BD7D80A55}.Release_NoRigidbody|Any CPU.ActiveCfg = Release_IncludeRigidbody|Any CPU
{DE17C145-3E8D-45D6-BBB6-D06BD7D80A55}.Release_NoRigidbody|Any CPU.Build.0 = Release_IncludeRigidbody|Any CPU
{DE17C145-3E8D-45D6-BBB6-D06BD7D80A55}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -37,6 +49,8 @@ Global
{421ACC19-8922-4E98-8921-B52240CE172A}.CompatibilityMode|Any CPU.Build.0 = CompatibilityMode|Any CPU
{421ACC19-8922-4E98-8921-B52240CE172A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{421ACC19-8922-4E98-8921-B52240CE172A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {421ACC19-8922-4E98-8921-B52240CE172A}.Release_IncludeRigidbody|Any CPU.ActiveCfg = Release_IncludeRigidbody|Any CPU
+ {421ACC19-8922-4E98-8921-B52240CE172A}.Release_IncludeRigidbody|Any CPU.Build.0 = Release_IncludeRigidbody|Any CPU
{421ACC19-8922-4E98-8921-B52240CE172A}.Release_NoRigidbody|Any CPU.ActiveCfg = Release_IncludeRigidbody|Any CPU
{421ACC19-8922-4E98-8921-B52240CE172A}.Release_NoRigidbody|Any CPU.Build.0 = Release_IncludeRigidbody|Any CPU
{421ACC19-8922-4E98-8921-B52240CE172A}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -45,44 +59,59 @@ Global
{20D2E542-D14F-4678-9C38-F3C0ECF6A2F6}.CompatibilityMode|Any CPU.Build.0 = CompatibilityMode|Any CPU
{20D2E542-D14F-4678-9C38-F3C0ECF6A2F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20D2E542-D14F-4678-9C38-F3C0ECF6A2F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {20D2E542-D14F-4678-9C38-F3C0ECF6A2F6}.Release_IncludeRigidbody|Any CPU.ActiveCfg = Release_IncludeRigidbody|Any CPU
+ {20D2E542-D14F-4678-9C38-F3C0ECF6A2F6}.Release_IncludeRigidbody|Any CPU.Build.0 = Release_IncludeRigidbody|Any CPU
{20D2E542-D14F-4678-9C38-F3C0ECF6A2F6}.Release_NoRigidbody|Any CPU.ActiveCfg = Release_IncludeRigidbody|Any CPU
{20D2E542-D14F-4678-9C38-F3C0ECF6A2F6}.Release_NoRigidbody|Any CPU.Build.0 = Release_IncludeRigidbody|Any CPU
{20D2E542-D14F-4678-9C38-F3C0ECF6A2F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20D2E542-D14F-4678-9C38-F3C0ECF6A2F6}.Release|Any CPU.Build.0 = Release|Any CPU
{978C0952-38D0-4C22-B96C-823EAFEDF0FA}.CompatibilityMode|Any CPU.ActiveCfg = CompatibilityMode|Any CPU
- {978C0952-38D0-4C22-B96C-823EAFEDF0FA}.CompatibilityMode|Any CPU.Build.0 = CompatibilityMode|Any CPU
{978C0952-38D0-4C22-B96C-823EAFEDF0FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {978C0952-38D0-4C22-B96C-823EAFEDF0FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {978C0952-38D0-4C22-B96C-823EAFEDF0FA}.Release_IncludeRigidbody|Any CPU.ActiveCfg = Release_IncludeRigidbody|Any CPU
{978C0952-38D0-4C22-B96C-823EAFEDF0FA}.Release_NoRigidbody|Any CPU.ActiveCfg = Release_IncludeRigidbody|Any CPU
- {978C0952-38D0-4C22-B96C-823EAFEDF0FA}.Release_NoRigidbody|Any CPU.Build.0 = Release_IncludeRigidbody|Any CPU
{978C0952-38D0-4C22-B96C-823EAFEDF0FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {978C0952-38D0-4C22-B96C-823EAFEDF0FA}.Release|Any CPU.Build.0 = Release|Any CPU
{279545AE-D268-42F0-A4C6-AA5BA15FB9BE}.CompatibilityMode|Any CPU.ActiveCfg = CompatibilityMode|Any CPU
{279545AE-D268-42F0-A4C6-AA5BA15FB9BE}.CompatibilityMode|Any CPU.Build.0 = CompatibilityMode|Any CPU
{279545AE-D268-42F0-A4C6-AA5BA15FB9BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{279545AE-D268-42F0-A4C6-AA5BA15FB9BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {279545AE-D268-42F0-A4C6-AA5BA15FB9BE}.Release_IncludeRigidbody|Any CPU.ActiveCfg = Release_IncludeRigidbody|Any CPU
+ {279545AE-D268-42F0-A4C6-AA5BA15FB9BE}.Release_IncludeRigidbody|Any CPU.Build.0 = Release_IncludeRigidbody|Any CPU
{279545AE-D268-42F0-A4C6-AA5BA15FB9BE}.Release_NoRigidbody|Any CPU.ActiveCfg = Release_IncludeRigidbody|Any CPU
{279545AE-D268-42F0-A4C6-AA5BA15FB9BE}.Release_NoRigidbody|Any CPU.Build.0 = Release_IncludeRigidbody|Any CPU
{279545AE-D268-42F0-A4C6-AA5BA15FB9BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{279545AE-D268-42F0-A4C6-AA5BA15FB9BE}.Release|Any CPU.Build.0 = Release|Any CPU
{AC1E5A23-CE58-419C-B165-EB1CD39AB433}.CompatibilityMode|Any CPU.ActiveCfg = CompatibilityMode|Any CPU
- {AC1E5A23-CE58-419C-B165-EB1CD39AB433}.CompatibilityMode|Any CPU.Build.0 = CompatibilityMode|Any CPU
{AC1E5A23-CE58-419C-B165-EB1CD39AB433}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AC1E5A23-CE58-419C-B165-EB1CD39AB433}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {AC1E5A23-CE58-419C-B165-EB1CD39AB433}.Release_IncludeRigidbody|Any CPU.ActiveCfg = Release_IncludeRigidbody|Any CPU
{AC1E5A23-CE58-419C-B165-EB1CD39AB433}.Release_NoRigidbody|Any CPU.ActiveCfg = Release_IncludeRigidbody|Any CPU
- {AC1E5A23-CE58-419C-B165-EB1CD39AB433}.Release_NoRigidbody|Any CPU.Build.0 = Release_IncludeRigidbody|Any CPU
{AC1E5A23-CE58-419C-B165-EB1CD39AB433}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AC1E5A23-CE58-419C-B165-EB1CD39AB433}.Release|Any CPU.Build.0 = Release|Any CPU
{930C3B07-B00A-44B8-A8E5-452A8FD125C7}.CompatibilityMode|Any CPU.ActiveCfg = CompatibilityMode|Any CPU
- {930C3B07-B00A-44B8-A8E5-452A8FD125C7}.CompatibilityMode|Any CPU.Build.0 = CompatibilityMode|Any CPU
{930C3B07-B00A-44B8-A8E5-452A8FD125C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {930C3B07-B00A-44B8-A8E5-452A8FD125C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {930C3B07-B00A-44B8-A8E5-452A8FD125C7}.Release_IncludeRigidbody|Any CPU.ActiveCfg = Release_IncludeRigidbody|Any CPU
{930C3B07-B00A-44B8-A8E5-452A8FD125C7}.Release_NoRigidbody|Any CPU.ActiveCfg = Release_IncludeRigidbody|Any CPU
- {930C3B07-B00A-44B8-A8E5-452A8FD125C7}.Release_NoRigidbody|Any CPU.Build.0 = Release_IncludeRigidbody|Any CPU
{930C3B07-B00A-44B8-A8E5-452A8FD125C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {930C3B07-B00A-44B8-A8E5-452A8FD125C7}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0B529A90-0B97-4840-BEB6-4A6700B46655}.CompatibilityMode|Any CPU.ActiveCfg = Release|Any CPU
+ {0B529A90-0B97-4840-BEB6-4A6700B46655}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0B529A90-0B97-4840-BEB6-4A6700B46655}.Release_IncludeRigidbody|Any CPU.ActiveCfg = Release|Any CPU
+ {0B529A90-0B97-4840-BEB6-4A6700B46655}.Release_NoRigidbody|Any CPU.ActiveCfg = Release|Any CPU
+ {0B529A90-0B97-4840-BEB6-4A6700B46655}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6BC7290B-999D-4688-959C-868306C1F52B}.CompatibilityMode|Any CPU.ActiveCfg = Release|Any CPU
+ {6BC7290B-999D-4688-959C-868306C1F52B}.CompatibilityMode|Any CPU.Build.0 = Release|Any CPU
+ {6BC7290B-999D-4688-959C-868306C1F52B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6BC7290B-999D-4688-959C-868306C1F52B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6BC7290B-999D-4688-959C-868306C1F52B}.Release_IncludeRigidbody|Any CPU.ActiveCfg = Release|Any CPU
+ {6BC7290B-999D-4688-959C-868306C1F52B}.Release_IncludeRigidbody|Any CPU.Build.0 = Release|Any CPU
+ {6BC7290B-999D-4688-959C-868306C1F52B}.Release_NoRigidbody|Any CPU.ActiveCfg = Release|Any CPU
+ {6BC7290B-999D-4688-959C-868306C1F52B}.Release_NoRigidbody|Any CPU.Build.0 = Release|Any CPU
+ {6BC7290B-999D-4688-959C-868306C1F52B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6BC7290B-999D-4688-959C-868306C1F52B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {978C0952-38D0-4C22-B96C-823EAFEDF0FA} = {3945F2EC-EA44-45DF-82B5-33E978AE8345}
+ {AC1E5A23-CE58-419C-B165-EB1CD39AB433} = {3945F2EC-EA44-45DF-82B5-33E978AE8345}
+ {930C3B07-B00A-44B8-A8E5-452A8FD125C7} = {3945F2EC-EA44-45DF-82B5-33E978AE8345}
+ EndGlobalSection
EndGlobal
diff --git a/_DOTween.Assembly/DOTween.sln.DotSettings b/_DOTween.Assembly/DOTween.sln.DotSettings
deleted file mode 100644
index 0f129db..0000000
--- a/_DOTween.Assembly/DOTween.sln.DotSettings
+++ /dev/null
@@ -1,2 +0,0 @@
-
- CY
\ No newline at end of file
diff --git a/_DOTween.Assembly/DOTween/Core/DOTweenComponent.cs b/_DOTween.Assembly/DOTween/Core/DOTweenComponent.cs
index 65d2d6f..7d83471 100644
--- a/_DOTween.Assembly/DOTween/Core/DOTweenComponent.cs
+++ b/_DOTween.Assembly/DOTween/Core/DOTweenComponent.cs
@@ -4,7 +4,9 @@
// License Copyright (c) Daniele Giardini.
// This work is subject to the terms at http://dotween.demigiant.com/license.php
+using System;
using System.Collections;
+using System.Reflection;
using UnityEngine;
#pragma warning disable 1591
@@ -31,6 +33,15 @@ namespace DG.Tweening.Core
{
inspectorUpdater = 0;
_unscaledTime = Time.realtimeSinceStartup;
+
+ // Initialize DOTweenModuleUtils via Reflection
+ Type modules = Utils.GetLooseScriptType("DG.Tweening.DOTweenModuleUtils");
+ if (modules == null) {
+ Debug.LogError("DOTween ► Couldn't load Modules system");
+ return;
+ }
+ MethodInfo mi = modules.GetMethod("Init", BindingFlags.Static | BindingFlags.Public);
+ mi.Invoke(null, null);
}
void Start()
diff --git a/_DOTween.Assembly/DOTween/Core/DOTweenExternalCommand.cs b/_DOTween.Assembly/DOTween/Core/DOTweenExternalCommand.cs
new file mode 100644
index 0000000..88aefb1
--- /dev/null
+++ b/_DOTween.Assembly/DOTween/Core/DOTweenExternalCommand.cs
@@ -0,0 +1,22 @@
+// Author: Daniele Giardini - http://www.demigiant.com
+// Created: 2018/07/13 19:21
+// License Copyright (c) Daniele Giardini
+// This work is subject to the terms at http://dotween.demigiant.com/license.php
+
+using System;
+using DG.Tweening.Plugins.Options;
+using UnityEngine;
+
+#pragma warning disable 1591
+namespace DG.Tweening.Core
+{
+ ///
+ /// Used to dispatch commands that need to be captured externally, usually by Modules
+ ///
+ public static class DOTweenExternalCommand
+ {
+ public static event Action SetOrientationOnPath;
+ internal static void Dispatch_SetOrientationOnPath(PathOptions options, Tween t, Quaternion newRot, Transform trans)
+ { if (SetOrientationOnPath != null) SetOrientationOnPath(options, t, newRot, trans); }
+ }
+}
\ No newline at end of file
diff --git a/_DOTween.Assembly/DOTween/Core/Enums/SpecialStartupMode.cs b/_DOTween.Assembly/DOTween/Core/Enums/SpecialStartupMode.cs
index b72ff64..6b2c12e 100644
--- a/_DOTween.Assembly/DOTween/Core/Enums/SpecialStartupMode.cs
+++ b/_DOTween.Assembly/DOTween/Core/Enums/SpecialStartupMode.cs
@@ -4,9 +4,10 @@
// License Copyright (c) Daniele Giardini.
// This work is subject to the terms at http://dotween.demigiant.com/license.php
+#pragma warning disable 1591
namespace DG.Tweening.Core.Enums
{
- internal enum SpecialStartupMode
+ public enum SpecialStartupMode
{
None,
SetLookAt,
diff --git a/_DOTween.Assembly/DOTween/Core/Extensions.cs b/_DOTween.Assembly/DOTween/Core/Extensions.cs
index 651cd27..aa7c2ae 100644
--- a/_DOTween.Assembly/DOTween/Core/Extensions.cs
+++ b/_DOTween.Assembly/DOTween/Core/Extensions.cs
@@ -14,27 +14,33 @@ namespace DG.Tweening.Core
///
public static class Extensions
{
- // Used internally by DO shortcuts to set special startup mode
- internal static T SetSpecialStartupMode(this T t, SpecialStartupMode mode) where T : Tween
+ ///
+ /// INTERNAL: used by DO shortcuts and Modules to set special startup mode
+ ///
+ public static T SetSpecialStartupMode(this T t, SpecialStartupMode mode) where T : Tween
{
t.specialStartupMode = mode;
return t;
}
- // Prevents a tween to use a From setup even if passed
- internal static TweenerCore NoFrom(this TweenerCore t)
- where TPlugOptions : struct, IPlugOptions
- {
- t.isFromAllowed = false;
- return t;
- }
-
- // Sets the tween as blendable
- internal static TweenerCore Blendable(this TweenerCore t)
+ ///
+ /// INTERNAL: used by DO shortcuts and Modules to set the tween as blendable
+ ///
+ public static TweenerCore Blendable(this TweenerCore t)
where TPlugOptions : struct, IPlugOptions
{
t.isBlendable = true;
return t;
}
+
+ ///
+ /// INTERNAL: used by DO shortcuts and Modules to prevent a tween from using a From setup even if passed
+ ///
+ public static TweenerCore NoFrom(this TweenerCore t)
+ where TPlugOptions : struct, IPlugOptions
+ {
+ t.isFromAllowed = false;
+ return t;
+ }
}
}
\ No newline at end of file
diff --git a/_DOTween.Assembly/DOTween/Core/Utils.cs b/_DOTween.Assembly/DOTween/Core/Utils.cs
index 1bc94db..e225613 100644
--- a/_DOTween.Assembly/DOTween/Core/Utils.cs
+++ b/_DOTween.Assembly/DOTween/Core/Utils.cs
@@ -4,12 +4,19 @@
// License Copyright (c) Daniele Giardini.
// This work is subject to the terms at http://dotween.demigiant.com/license.php
+using System;
+using System.Reflection;
using UnityEngine;
namespace DG.Tweening.Core
{
internal static class Utils
{
+ static Assembly[] _loadedAssemblies;
+ static readonly string[] _defAssembliesToQuery = new[] { // First assemblies to look into before checking all of them
+ "Assembly-CSharp", "Assembly-CSharp-firstpass"
+ };
+
///
/// Returns a Vector3 with z = 0
///
@@ -44,6 +51,27 @@ namespace DG.Tweening.Core
&& Mathf.Approximately(a.z, b.z);
}
+ ///
+ /// Looks for the type withing all possible project assembly names
+ ///
+ internal static Type GetLooseScriptType(string typeName)
+ {
+ // Check in default assemblies (Unity 2017 and later)
+ for (int i = 0; i < _defAssembliesToQuery.Length; ++i) {
+ Type result = Type.GetType(string.Format("{0}, {1}", typeName, _defAssembliesToQuery[i]));
+ if (result == null) continue;
+ return result;
+ }
+ // Check in all assemblies
+ if (_loadedAssemblies == null) _loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies();
+ for (int i = 0; i < _loadedAssemblies.Length; ++i) {
+ Type result = Type.GetType(string.Format("{0}, {1}", typeName, _loadedAssemblies[i].GetName()));
+ if (result == null) continue;
+ return result;
+ }
+ return null;
+ }
+
// █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
// ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████
// █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
diff --git a/_DOTween.Assembly/DOTween/DOTween.cs b/_DOTween.Assembly/DOTween/DOTween.cs
index b3560b8..6e5187f 100644
--- a/_DOTween.Assembly/DOTween/DOTween.cs
+++ b/_DOTween.Assembly/DOTween/DOTween.cs
@@ -32,7 +32,7 @@ namespace DG.Tweening
public class DOTween
{
/// DOTween's version
- public static readonly string Version = "1.1.755";
+ public static readonly string Version = "1.2.004"; // Last version before modules: 1.1.755
///////////////////////////////////////////////
// Options ////////////////////////////////////
diff --git a/_DOTween.Assembly/DOTween/DOTween.csproj b/_DOTween.Assembly/DOTween/DOTween.csproj
index 907fd0e..3e46965 100644
--- a/_DOTween.Assembly/DOTween/DOTween.csproj
+++ b/_DOTween.Assembly/DOTween/DOTween.csproj
@@ -64,7 +64,7 @@
- C:\Program Files (x86)\Unity 3\Editor\Data\Managed\UnityEngine.dll
+ C:\Program Files (x86)\Unity 46\Editor\Data\Managed\UnityEngine.dll
False
@@ -87,6 +87,7 @@
+
@@ -166,47 +167,7 @@
- set BinDir=bin.Global\DOTween
-set DestinationDir=$(SolutionDir)..\..\%25BinDir%25
-set BinDirNoMeta=bin.Global_no_meta\DOTween
-set DestinationDirNoMeta=$(SolutionDir)..\..\%25BinDirNoMeta%25
-set BinDirUnityTests=UnityTests.Unity4\Assets\Demigiant\DOTween
-set DestinationDirUnityTests=$(SolutionDir)..\%25BinDirUnityTests%25
-set BinDirUnity5Tests=UnityTests.Unity5\Assets\Demigiant\DOTween
-set DestinationDirUnity5Tests=$(SolutionDir)..\%25BinDirUnity5Tests%25
-set BinDirCompatibilityTests=UnityCompatibilityTests.Unity35\Assets\Demigiant\DOTween
-set DestinationDirCompatibilityTests=$(SolutionDir)..\%25BinDirCompatibilityTests%25
-set BinDirExtPluginsTests=ExternalPluginsTestsAndExamples.Unity5\Assets\Demigiant\DOTween
-set DestinationDirExtPluginsTests=$(SolutionDir)..\%25BinDirExtPluginsTests%25
-
-echo %25DestinationDir%25
-
-echo Deleting TMPs...
-DEL $(TargetDir)\*.tmp
-
-CD $(TargetDir)
-echo Converting PDB to MDB and deleting PDB...
-"c:\Program Files\pdb2mdb\pdb2mdb.exe" $(TargetFileName)
-DEL $(TargetName).pdb
-
-echo Exporting Assembly to %25DestinationDir%25
-echo Copying files to Destination...
-echo f | xcopy "$(SolutionDir)\bin" %25DestinationDir%25 /Y /I /E
-
-echo Exporting Assembly to %25DestinationDirNoMeta%25
-echo f | xcopy "$(SolutionDir)\bin" %25DestinationDirNoMeta%25 /Y /I /E
-
-echo Exporting Assembly to %25DestinationDirUnityTests%25
-echo f | xcopy "$(SolutionDir)\bin" %25DestinationDirUnityTests%25 /Y /I /E
-
-echo Exporting Assembly to %25DestinationDirUnity5Tests%25
-echo f | xcopy "$(SolutionDir)\bin" %25DestinationDirUnity5Tests%25 /Y /I /E
-
-echo Exporting Assembly to %25DestinationDirCompatibilityTests%25
-echo f | xcopy "$(SolutionDir)\bin" %25DestinationDirCompatibilityTests%25 /Y /I /E
-
-echo Exporting Assembly to %25DestinationDirExtPluginsTests%25
-echo f | xcopy "$(SolutionDir)\bin" %25DestinationDirExtPluginsTests%25 /Y /I /E
+ call $(SolutionDir)PostBuild_DOTween.bat $(SolutionDir) $(TargetDir) $(TargetFileName) $(TargetName) DOTween bin
+
\ No newline at end of file
diff --git a/_DOTween.Assembly/DOTweenUpgradeManager/Properties/AssemblyInfo.cs b/_DOTween.Assembly/DOTweenUpgradeManager/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..6d06ebc
--- /dev/null
+++ b/_DOTween.Assembly/DOTweenUpgradeManager/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("DOTweenUpgradeManager")]
+[assembly: AssemblyDescription("Upgrade manager for DOTween")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Demigiant")]
+[assembly: AssemblyProduct("DOTweenUpgradeManager")]
+[assembly: AssemblyCopyright("Copyright © Daniele Giardini, Demigiant 2018")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("807e068c-2a0e-4c81-a303-4b4fd3924511")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/_DOTween.Assembly/DOTween_LooseScripts/DOTween_LooseScripts.csproj b/_DOTween.Assembly/DOTween_LooseScripts/DOTween_LooseScripts.csproj
new file mode 100644
index 0000000..c178fca
--- /dev/null
+++ b/_DOTween.Assembly/DOTween_LooseScripts/DOTween_LooseScripts.csproj
@@ -0,0 +1,121 @@
+
+
+
+ Debug
+ AnyCPU
+ 8.0.30703
+ 2.0
+ {0B529A90-0B97-4840-BEB6-4A6700B46655}
+ Library
+ Properties
+ DG.Tweening
+ DOTween_LooseScripts
+ v3.5
+ 512
+ Unity Subset v3.5
+
+
+ true
+ full
+ false
+ ..\bin\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ 1591
+
+
+ pdbonly
+ true
+ ..\bin\
+ TRACE;DOTAUDIO;DOTPHYSICS;DOTPHYSICS2D;DOTSPRITE;DOTUI;UNITY_4_3;UNITY_4_6;UNITY_5;UNITY_2017_0_OR_NEWER
+ prompt
+ 4
+
+
+ 1573
+
+
+
+ ..\..\..\bin.Global_no_meta\DemiLib\Core\Editor\DemiEditor.dll
+ False
+
+
+ ..\..\..\bin.Global_no_meta\DemiLib\Core\DemiLib.dll
+ False
+
+
+
+ C:\Program Files\Unity\Editor\Data\Managed\UnityEditor.dll
+ False
+
+
+ C:\Program Files\Unity\Editor\Data\Managed\UnityEngine.dll
+ False
+
+
+ C:\Program Files\Unity\Editor\Data\UnityExtensions\Unity\GUISystem\UnityEngine.UI.dll
+ False
+
+
+
+
+
+ bin\%(FileName)
+
+
+ bin\%(FileName)
+
+
+ bin\Modules\%(FileName)
+
+
+ bin\Modules\%(FileName)
+
+
+ bin_pro\%(FileName)
+
+
+ bin_pro\%(FileName)
+
+
+ bin_pro\Editor\%(FileName)
+
+
+
+
+ {421acc19-8922-4e98-8921-b52240ce172a}
+ DOTweenEditor
+ False
+
+
+ {279545ae-d268-42f0-a4c6-aa5ba15fb9be}
+ DOTweenProEditor
+ False
+
+
+ {20d2e542-d14f-4678-9c38-f3c0ecf6a2f6}
+ DOTweenPro
+ False
+
+
+ {de17c145-3e8d-45d6-bbb6-d06bd7d80a55}
+ DOTween
+ False
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_DOTween.Assembly/DOTween_LooseScripts/Properties/AssemblyInfo.cs b/_DOTween.Assembly/DOTween_LooseScripts/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..977fd30
--- /dev/null
+++ b/_DOTween.Assembly/DOTween_LooseScripts/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("DOTween_LooseScripts")]
+[assembly: AssemblyDescription("Deals with lose scripts inside bin and bin_pro folders")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Demigiant")]
+[assembly: AssemblyProduct("DOTween_LooseScripts")]
+[assembly: AssemblyCopyright("Copyright © Daniele Giardini, Demigiant 2018")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("807e068c-2a0e-4c81-a303-4b4fd3924511")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/_DOTween.Assembly/PostBuild_DOTween.bat b/_DOTween.Assembly/PostBuild_DOTween.bat
new file mode 100644
index 0000000..e59dafd
--- /dev/null
+++ b/_DOTween.Assembly/PostBuild_DOTween.bat
@@ -0,0 +1,80 @@
+:: %1 = $(SolutionDir) ► Solution dir path - with final slash
+:: %2 = $(TargetDir) ► Bin folder dir path - with final slash
+:: %3 = $(TargetFileName) ► DLL filename with extension
+:: %4 = $(TargetName) ► DLL filename without extension
+:: %5 = Main export dir ► Main folder inside bin.Global/etc where to copy the files (ex: "DOTween", "DOTweenPro")
+:: %6 = Bin dir name ► (ex: "bin", "bin_pro")
+:: %7 = Eventual export subdir (can be NULL) ► Eventual subdirectory inside the main export dir (ex: "Editor")
+
+echo :
+echo :
+echo :
+echo :
+echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+echo :::::::::::::::::: EXECUTING BATCH FILE :::::::::::::::::::::::
+echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+echo :
+echo :
+echo :
+echo :
+echo :::::: TARGET: %5 %7
+
+echo :::::: Deleting TMPs...
+DEL %2*.tmp
+
+echo :::::: Converting PDB to MDB and deleting PDB...
+CD %2
+"c:\Program Files\pdb2mdb\pdb2mdb.exe" %3
+echo ::: Deleting PDB files: %4.pdb
+DEL %4.pdb
+echo ::: PDB files deleted, PAUSE for 0.5 second
+waitfor pdbFilesToBeDeletedIHope /t 0.5 2>NUL || type nul>nul
+
+echo :::::: Starting export...
+
+set SubDir=%7
+if not "%SubDir%"=="" ( set SubDir=\%7 )
+set CopyFromDir=%1%6%SubDir%
+
+set CopyToDir=%1..\..\bin.Global\%5%SubDir%
+set CopyToDirNoMeta=%1..\..\bin.Global_no_meta\%5%SubDir%
+set CopyToDirUnityTests=%1..\UnityTests.Unity4\Assets\Demigiant\%5%SubDir%
+set CopyToDirUnity5Tests=%1..\UnityTests.Unity5\Assets\Demigiant\%5%SubDir%
+set CopyToDirCompatibilityTests=%1..\UnityCompatibilityTests.Unity35\Assets\Demigiant\%5%SubDir%
+set CopyToDirExtPluginsTests=%1..\ExternalPluginsTestsAndExamples.Unity5\Assets\Demigiant\%5%SubDir%
+set CopyToDirModulesTest=%1..\ModulesTest.Unity2018\Assets\Demigiant\%5%SubDir%
+
+:: Modules test project
+echo ::: Exporting from %CopyFromDir% to %CopyToDirModulesTest%
+echo f | xcopy %CopyFromDir% %CopyToDirModulesTest% /Y /I /E
+:: bin.Global - Ignore, not good anymore
+:: echo ::: Exporting from %CopyFromDir% to %CopyToDir%
+:: echo f | xcopy %CopyFromDir% %CopyToDir% /Y /I /E
+:: bin.Global_no_meta
+echo ::: Exporting from %CopyFromDir% to %CopyToDirNoMeta%
+echo f | xcopy %CopyFromDir% %CopyToDirNoMeta% /Y /I /E
+:: UnityTests.Unity5
+echo ::: Exporting from %CopyFromDir% to %CopyToDirUnity5Tests%
+echo f | xcopy %CopyFromDir% %CopyToDirUnity5Tests% /Y /I /E
+exit /B
+:: UnityTests.Unity4
+echo ::: Exporting from %CopyFromDir% to %CopyToDirUnityTests%
+echo f | xcopy %CopyFromDir% %CopyToDirUnityTests% /Y /I /E
+:: UnityCompatibilityTests.Unity35
+echo ::: Exporting from %CopyFromDir% to %CopyToDirCompatibilityTests%
+echo f | xcopy %CopyFromDir% %CopyToDirCompatibilityTests% /Y /I /E
+:: ExternalPluginsTestsAndExamples.Unity5
+echo ::: Exporting from %CopyFromDir% to %CopyToDirExtPluginsTests%
+echo f | xcopy %CopyFromDir% %CopyToDirExtPluginsTests% /Y /I /E
+
+echo :
+echo :
+echo :
+echo :
+echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+echo ::::::::::::::::::::: BATCH FILE END ::::::::::::::::::::::::::
+echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+echo :
+echo :
+echo :
+echo :
\ No newline at end of file
diff --git a/_DOTween.Assembly/bin/DOTween.XML b/_DOTween.Assembly/bin/DOTween.XML
index 2c3ec4d..0001102 100644
--- a/_DOTween.Assembly/bin/DOTween.XML
+++ b/_DOTween.Assembly/bin/DOTween.XML
@@ -179,6 +179,26 @@
Public only so custom shortcuts can access some of these methods
+
+
+ INTERNAL: used by DO shortcuts and Modules to set special startup mode
+
+
+
+
+ INTERNAL: used by DO shortcuts and Modules to set the tween as blendable
+
+
+
+
+ INTERNAL: used by DO shortcuts and Modules to prevent a tween from using a From setup even if passed
+
+
+
+
+ Used to dispatch commands that need to be captured externally, usually by Modules
+
+
Returns a Vector3 with z = 0
@@ -195,6 +215,11 @@
because the latter fails (in some cases) when assigning a Vector3 to a transform.position and then checking it.
+
+
+ Looks for the type withing all possible project assembly names
+
+
Struct that stores two colors (used for LineRenderer tweens)
@@ -1239,16 +1264,6 @@
Methods that extend known Unity objects and allow to directly create and control tweens from their instances
-
- Tweens an AudioSource's volume to the given value.
- Also stores the AudioSource as the tween's target so it can be used for filtered operations
- The end value to reach (0 to 1)The duration of the tween
-
-
- Tweens an AudioSource's pitch to the given value.
- Also stores the AudioSource as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
Tweens a Camera's aspect to the given value.
Also stores the camera as the tween's target so it can be used for filtered operations
@@ -1418,81 +1433,6 @@
The name of the material property to tween
The duration of the tween
-
- Tweens a Rigidbody's position to the given value.
- Also stores the rigidbody as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Rigidbody's X position to the given value.
- Also stores the rigidbody as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Rigidbody's Y position to the given value.
- Also stores the rigidbody as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Rigidbody's Z position to the given value.
- Also stores the rigidbody as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Rigidbody's rotation to the given value.
- Also stores the rigidbody as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- Rotation mode
-
-
- Tweens a Rigidbody's rotation so that it will look towards the given position.
- Also stores the rigidbody as the tween's target so it can be used for filtered operations
- The position to look atThe duration of the tween
- Eventual axis constraint for the rotation
- The vector that defines in which direction up is (default: Vector3.up)
-
-
- Tweens a Rigidbody's position to the given value, while also applying a jump effect along the Y axis.
- Returns a Sequence instead of a Tweener.
- Also stores the Rigidbody as the tween's target so it can be used for filtered operations
- The end value to reach
- Power of the jump (the max height of the jump is represented by this plus the final Y offset)
- Total number of jumps
- The duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Rigidbody's position through the given path waypoints, using the chosen path algorithm.
- Also stores the Rigidbody as the tween's target so it can be used for filtered operations.
- NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.
- BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug).
- If you plan to publish there you should use a regular transform.DOPath.
- The waypoints to go through
- The duration of the tween
- The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)
- The path mode: 3D, side-scroller 2D, top-down 2D
- The resolution of the path (useless in case of Linear paths): higher resolutions make for more detailed curved paths but are more expensive.
- Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints
- The color of the path (shown when gizmos are active in the Play panel and the tween is running)
-
-
- Tweens a Rigidbody's localPosition through the given path waypoints, using the chosen path algorithm.
- Also stores the Rigidbody as the tween's target so it can be used for filtered operations
- NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.
- BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug).
- If you plan to publish there you should use a regular transform.DOLocalPath.
- The waypoint to go through
- The duration of the tween
- The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)
- The path mode: 3D, side-scroller 2D, top-down 2D
- The resolution of the path: higher resolutions make for more detailed curved paths but are more expensive.
- Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints
- The color of the path (shown when gizmos are active in the Play panel and the tween is running)
-
Tweens a TrailRenderer's startWidth/endWidth to the given value.
Also stores the TrailRenderer as the tween's target so it can be used for filtered operations
@@ -1743,6 +1683,22 @@
Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints
The color of the path (shown when gizmos are active in the Play panel and the tween is running)
+
+ IMPORTANT: Unless you really know what you're doing, you should use the overload that accepts a Vector3 array instead.
+ Tweens a Transform's position via the given path.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The path to use
+ The duration of the tween
+ The path mode: 3D, side-scroller 2D, top-down 2D
+
+
+ IMPORTANT: Unless you really know what you're doing, you should use the overload that accepts a Vector3 array instead.
+ Tweens a Transform's localPosition via the given path.
+ Also stores the transform as the tween's target so it can be used for filtered operations
+ The path to use
+ The duration of the tween
+ The path mode: 3D, side-scroller 2D, top-down 2D
+
Tweens a Tween's timeScale to the given value.
Also stores the Tween as the tween's target so it can be used for filtered operations
@@ -2523,9 +2479,21 @@
Called when a path tween's current waypoint changes
+
+ Tweeners-only (ignored by Sequences), returns TRUE if the tween was set as relative
+
+
+ FALSE when tween is (or should be) despawned - set only by TweenManager
+
Gets and sets the time position (loops included, delays excluded) of the tween
+
+ TRUE after the tween was set in a play state at least once, AFTER any delay is elapsed
+
+
+ Time position within a single loop cycle
+
Animates a single value
diff --git a/_DOTween.Assembly/bin/DOTween.dll b/_DOTween.Assembly/bin/DOTween.dll
index dd8bf57..7a86edc 100644
Binary files a/_DOTween.Assembly/bin/DOTween.dll and b/_DOTween.Assembly/bin/DOTween.dll differ
diff --git a/_DOTween.Assembly/bin/DOTween.dll.mdb b/_DOTween.Assembly/bin/DOTween.dll.mdb
index 7e60f1b..25287c6 100644
Binary files a/_DOTween.Assembly/bin/DOTween.dll.mdb and b/_DOTween.Assembly/bin/DOTween.dll.mdb differ
diff --git a/_DOTween.Assembly/bin/DOTween43.dll b/_DOTween.Assembly/bin/DOTween43.dll
deleted file mode 100644
index 590ab8e..0000000
Binary files a/_DOTween.Assembly/bin/DOTween43.dll and /dev/null differ
diff --git a/_DOTween.Assembly/bin/DOTween43.dll.mdb b/_DOTween.Assembly/bin/DOTween43.dll.mdb
deleted file mode 100644
index eb000af..0000000
Binary files a/_DOTween.Assembly/bin/DOTween43.dll.mdb and /dev/null differ
diff --git a/_DOTween.Assembly/bin/DOTween43.xml b/_DOTween.Assembly/bin/DOTween43.xml
deleted file mode 100644
index f0efe2b..0000000
--- a/_DOTween.Assembly/bin/DOTween43.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
- DOTween43
-
-
-
-
- Methods that extend known Unity objects and allow to directly create and control tweens from their instances.
- These, as all DOTween43 methods, require Unity 4.3 or later.
-
-
-
- Tweens a Material's color using the given gradient
- (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
- Also stores the image as the tween's target so it can be used for filtered operations
- The gradient to useThe duration of the tween
-
-
- Tweens a Material's named color property using the given gradient
- (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
- Also stores the image as the tween's target so it can be used for filtered operations
- The gradient to use
- The name of the material property to tween (like _Tint or _SpecColor)
- The duration of the tween
-
-
- Tweens a SpriteRenderer's color to the given value.
- Also stores the spriteRenderer as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a Material's alpha color to the given value.
- Also stores the spriteRenderer as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a SpriteRenderer's color using the given gradient
- (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
- Also stores the image as the tween's target so it can be used for filtered operations
- The gradient to useThe duration of the tween
-
-
- Tweens a Rigidbody2D's position to the given value.
- Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Rigidbody2D's X position to the given value.
- Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Rigidbody2D's Y position to the given value.
- Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Rigidbody2D's rotation to the given value.
- Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a Rigidbody2D's position to the given value, while also applying a jump effect along the Y axis.
- Returns a Sequence instead of a Tweener.
- Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations.
- IMPORTANT: a rigidbody2D can't be animated in a jump arc using MovePosition, so the tween will directly set the position
- The end value to reach
- Power of the jump (the max height of the jump is represented by this plus the final Y offset)
- Total number of jumps
- The duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a SpriteRenderer's color to the given value,
- in a way that allows other DOBlendableColor tweens to work together on the same target,
- instead than fight each other as multiple DOColor would do.
- Also stores the SpriteRenderer as the tween's target so it can be used for filtered operations
- The value to tween toThe duration of the tween
-
-
-
diff --git a/_DOTween.Assembly/bin/DOTween46.dll b/_DOTween.Assembly/bin/DOTween46.dll
deleted file mode 100644
index 79daf78..0000000
Binary files a/_DOTween.Assembly/bin/DOTween46.dll and /dev/null differ
diff --git a/_DOTween.Assembly/bin/DOTween46.dll.mdb b/_DOTween.Assembly/bin/DOTween46.dll.mdb
deleted file mode 100644
index 07e7800..0000000
Binary files a/_DOTween.Assembly/bin/DOTween46.dll.mdb and /dev/null differ
diff --git a/_DOTween.Assembly/bin/DOTween46.xml b/_DOTween.Assembly/bin/DOTween46.xml
deleted file mode 100644
index 4c0ff32..0000000
--- a/_DOTween.Assembly/bin/DOTween46.xml
+++ /dev/null
@@ -1,279 +0,0 @@
-
-
-
- DOTween46
-
-
-
-
- Various utils that require Unity 4.6 or later
-
-
-
-
- Converts the anchoredPosition of the first RectTransform to the second RectTransform,
- taking into consideration offset, anchors and pivot, and returns the new anchoredPosition
-
-
-
-
- Methods that extend known Unity objects and allow to directly create and control tweens from their instances.
- These, as all DOTween46 methods, require Unity 4.6 or later.
-
-
-
- Tweens a CanvasGroup's alpha color to the given value.
- Also stores the canvasGroup as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens an Graphic's color to the given value.
- Also stores the image as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens an Graphic's alpha color to the given value.
- Also stores the image as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens an Image's color to the given value.
- Also stores the image as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens an Image's alpha color to the given value.
- Also stores the image as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens an Image's fillAmount to the given value.
- Also stores the image as the tween's target so it can be used for filtered operations
- The end value to reach (0 to 1)The duration of the tween
-
-
- Tweens an Image's colors using the given gradient
- (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
- Also stores the image as the tween's target so it can be used for filtered operations
- The gradient to useThe duration of the tween
-
-
- Tweens an LayoutElement's flexibleWidth/Height to the given value.
- Also stores the LayoutElement as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens an LayoutElement's minWidth/Height to the given value.
- Also stores the LayoutElement as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens an LayoutElement's preferredWidth/Height to the given value.
- Also stores the LayoutElement as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Outline's effectColor to the given value.
- Also stores the Outline as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a Outline's effectColor alpha to the given value.
- Also stores the Outline as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a Outline's effectDistance to the given value.
- Also stores the Outline as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a RectTransform's anchoredPosition to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a RectTransform's anchoredPosition X to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a RectTransform's anchoredPosition Y to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a RectTransform's anchoredPosition3D to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a RectTransform's anchoredPosition3D X to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a RectTransform's anchoredPosition3D Y to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a RectTransform's anchoredPosition3D Z to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a RectTransform's anchorMax to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a RectTransform's anchorMin to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a RectTransform's pivot to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a RectTransform's pivot X to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a RectTransform's pivot Y to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a RectTransform's sizeDelta to the given value.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Punches a RectTransform's anchoredPosition towards the given direction and then back to the starting one
- as if it was connected to the starting position via an elastic.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The direction and strength of the punch (added to the RectTransform's current position)
- The duration of the tween
- Indicates how much will the punch vibrate
- Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards.
- 1 creates a full oscillation between the punch direction and the opposite direction,
- while 0 oscillates only between the punch and the start position
- If TRUE the tween will smoothly snap all values to integers
-
-
- 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
- The duration of the tween
- The shake strength
- Indicates how much will the shake vibrate
- 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.
- If TRUE the tween will smoothly snap all values to integers
- If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not
-
-
- 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
- The duration of the tween
- The shake strength on each axis
- Indicates how much will the shake vibrate
- 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.
- If TRUE the tween will smoothly snap all values to integers
- If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not
-
-
- Tweens a RectTransform's anchoredPosition to the given value, while also applying a jump effect along the Y axis.
- Returns a Sequence instead of a Tweener.
- Also stores the RectTransform as the tween's target so it can be used for filtered operations
- The end value to reach
- Power of the jump (the max height of the jump is represented by this plus the final Y offset)
- Total number of jumps
- The duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a ScrollRect's horizontal/verticalNormalizedPosition to the given value.
- Also stores the ScrollRect as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a ScrollRect's horizontalNormalizedPosition to the given value.
- Also stores the ScrollRect as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a ScrollRect's verticalNormalizedPosition to the given value.
- Also stores the ScrollRect as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Slider's value to the given value.
- Also stores the Slider as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
- If TRUE the tween will smoothly snap all values to integers
-
-
- Tweens a Text's color to the given value.
- Also stores the Text as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a Text's alpha color to the given value.
- Also stores the Text as the tween's target so it can be used for filtered operations
- The end value to reachThe duration of the tween
-
-
- Tweens a Text's text to the given value.
- Also stores the Text as the tween's target so it can be used for filtered operations
- The end string to tween toThe duration of the tween
- If TRUE (default), rich text will be interpreted correctly while animated,
- otherwise all tags will be considered as normal text
- The type of scramble mode to use, if any
- 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
-
-
- Tweens a Graphic's color to the given value,
- in a way that allows other DOBlendableColor tweens to work together on the same target,
- instead than fight each other as multiple DOColor would do.
- Also stores the Graphic as the tween's target so it can be used for filtered operations
- The value to tween toThe duration of the tween
-
-
- Tweens a Image's color to the given value,
- in a way that allows other DOBlendableColor tweens to work together on the same target,
- instead than fight each other as multiple DOColor would do.
- Also stores the Image as the tween's target so it can be used for filtered operations
- The value to tween toThe duration of the tween
-
-
- Tweens a Text's color BY the given value,
- in a way that allows other DOBlendableColor tweens to work together on the same target,
- instead than fight each other as multiple DOColor would do.
- Also stores the Text as the tween's target so it can be used for filtered operations
- The value to tween toThe duration of the tween
-
-
-
diff --git a/_DOTween.Assembly/bin/DOTween50.dll b/_DOTween.Assembly/bin/DOTween50.dll
deleted file mode 100644
index d8acdcd..0000000
Binary files a/_DOTween.Assembly/bin/DOTween50.dll and /dev/null differ
diff --git a/_DOTween.Assembly/bin/DOTween50.dll.mdb b/_DOTween.Assembly/bin/DOTween50.dll.mdb
deleted file mode 100644
index 47d825a..0000000
Binary files a/_DOTween.Assembly/bin/DOTween50.dll.mdb and /dev/null differ
diff --git a/_DOTween.Assembly/bin/DOTween50.xml b/_DOTween.Assembly/bin/DOTween50.xml
deleted file mode 100644
index e82f711..0000000
--- a/_DOTween.Assembly/bin/DOTween50.xml
+++ /dev/null
@@ -1,163 +0,0 @@
-
-
-
- DOTween50
-
-
-
-
- Methods that extend known Unity objects and allow to directly create and control tweens from their instances.
- These, as all DOTween50 methods, require Unity 5.0 or later.
-
-
-
- Tweens an AudioMixer's exposed float to the given value.
- Also stores the AudioMixer as the tween's target so it can be used for filtered operations.
- Note that you need to manually expose a float in an AudioMixerGroup in order to be able to tween it from an AudioMixer.
- Name given to the exposed float to set
- The end value to reachThe duration of the tween
-
-
-
- Completes all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens completed
- (meaning the tweens that don't have infinite loops and were not already complete)
-
- For Sequences only: if TRUE also internal Sequence callbacks will be fired,
- otherwise they will be ignored
-
-
-
- Kills all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens killed.
-
- If TRUE completes the tween before killing it
-
-
-
- Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens flipped.
-
-
-
-
- Sends to the given position all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens involved.
-
- Time position to reach
- (if higher than the whole tween duration the tween will simply reach its end)
- If TRUE will play the tween after reaching the given position, otherwise it will pause it
-
-
-
- Pauses all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens paused.
-
-
-
-
- Plays all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens played.
-
-
-
-
- Plays backwards all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens played.
-
-
-
-
- Plays forward all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens played.
-
-
-
-
- Restarts all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens restarted.
-
-
-
-
- Rewinds all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens rewinded.
-
-
-
-
- Smoothly rewinds all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens rewinded.
-
-
-
-
- Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
- (meaning tweens that were started from this target, or that had this target added as an Id)
- and returns the total number of tweens involved.
-
-
-
-
- Methods that extend Tween objects and allow to control or get data from them.
- These require at least Unity 5.3
-
-
-
-
- Returns a that waits until the tween is killed or complete.
- It can be used inside a coroutine as a yield.
- Example usage:yield return myTween.WaitForCompletion(true);
-
-
-
-
- Returns a that waits until the tween is killed or rewinded.
- It can be used inside a coroutine as a yield.
- Example usage:yield return myTween.WaitForRewind();
-
-
-
-
- Returns a that waits until the tween is killed.
- It can be used inside a coroutine as a yield.
- Example usage:yield return myTween.WaitForKill();
-
-
-
-
- Returns a that waits until the tween is killed or has gone through the given amount of loops.
- It can be used inside a coroutine as a yield.
- Example usage:yield return myTween.WaitForElapsedLoops(2);
-
- Elapsed loops to wait for
-
-
-
- Returns a that waits until the tween is killed or has reached the given position (loops included, delays excluded).
- It can be used inside a coroutine as a yield.
- Example usage:yield return myTween.WaitForPosition(2.5f);
-
- Position (loops included, delays excluded) to wait for
-
-
-
- Returns a that waits until the tween is killed or started
- (meaning when the tween is set in a playing state the first time, after any eventual delay).
- It can be used inside a coroutine as a yield.
- Example usage:yield return myTween.WaitForStart();
-
-
-
-
diff --git a/_DOTween.Assembly/bin/Editor/DOTweenEditor.XML b/_DOTween.Assembly/bin/Editor/DOTweenEditor.XML
index 6afe743..6666e3e 100644
--- a/_DOTween.Assembly/bin/Editor/DOTweenEditor.XML
+++ b/_DOTween.Assembly/bin/Editor/DOTweenEditor.XML
@@ -4,37 +4,37 @@
DOTweenEditor
-
+
Checks that the given editor texture use the correct import settings,
and applies them if they're incorrect.
-
+
- Returns TRUE if addons setup is required.
+ Returns TRUE if setup is required
-
+
Returns TRUE if the file/directory at the given path exists.
Path, relative to Unity's project folder
-
+
Converts the given project-relative path to a full path,
with backward (\) slashes).
-
+
Converts the given full path to a path usable with AssetDatabase methods
(relative to Unity's project folder, and with the correct Unity forward (/) slashes).
-
+
Connects to a asset.
If the asset already exists at the given path, loads it and returns it.
@@ -45,21 +45,33 @@
File path (relative to Unity's project folder)
If TRUE and the requested asset doesn't exist, forces its creation
-
+
Full path for the given loaded assembly, assembly file included
-
+
+
+ Adds the given global define if it's not already present
+
+
+
+
+ Removes the given global define if it's present
+
+
+
+
+ Returns TRUE if the given global define is present in all the
+ or only in the given , depending on passed parameters.
+
+
+ to use. Leave NULL to check in all of them.
+
+
Not used as menu item anymore, but as a utiity function
-
-
- Setups DOTween
-
- If TRUE, no warning window appears in case there is no need for setup
-
diff --git a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll
index abd34df..84a3ac5 100644
Binary files a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll and b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll differ
diff --git a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb
index e0918e3..30eb36c 100644
Binary files a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb and b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb differ
diff --git a/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.XML b/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.XML
new file mode 100644
index 0000000..02c3c95
--- /dev/null
+++ b/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.XML
@@ -0,0 +1,14 @@
+
+
+
+ DOTweenUpgradeManager
+
+
+
+
+ This class and its whole library are deleted the first time DOTween's setup is run after an upgrade (or after a new install).
+ NOTE: DidReloadScripts doesn't work on first install so it's useless, InitializeOnLoad is the only way
+
+
+
+
diff --git a/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll b/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll
new file mode 100644
index 0000000..b11387b
Binary files /dev/null and b/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll differ
diff --git a/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll.mdb b/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll.mdb
new file mode 100644
index 0000000..fafa3a3
Binary files /dev/null and b/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll.mdb differ
diff --git a/_DOTween.Assembly/bin/Modules/DOTweenModuleAudio.cs b/_DOTween.Assembly/bin/Modules/DOTweenModuleAudio.cs
new file mode 100644
index 0000000..c9b77af
--- /dev/null
+++ b/_DOTween.Assembly/bin/Modules/DOTweenModuleAudio.cs
@@ -0,0 +1,193 @@
+// Author: Daniele Giardini - http://www.demigiant.com
+// Created: 2018/07/13
+
+#if DOTAUDIO
+using System;
+using UnityEngine;
+using UnityEngine.Audio;
+
+#pragma warning disable 1591
+namespace DG.Tweening
+{
+ public static class DOTweenModuleAudio
+ {
+ #region Shortcuts
+
+ #region Audio
+
+ /// Tweens an AudioSource's volume to the given value.
+ /// Also stores the AudioSource as the tween's target so it can be used for filtered operations
+ /// The end value to reach (0 to 1)The duration of the tween
+ public static Tweener DOFade(this AudioSource target, float endValue, float duration)
+ {
+ if (endValue < 0) endValue = 0;
+ else if (endValue > 1) endValue = 1;
+ return DOTween.To(() => target.volume, x => target.volume = x, endValue, duration).SetTarget(target);
+ }
+
+ /// Tweens an AudioSource's pitch to the given value.
+ /// Also stores the AudioSource as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOPitch(this AudioSource target, float endValue, float duration)
+ {
+ return DOTween.To(() => target.pitch, x => target.pitch = x, endValue, duration).SetTarget(target);
+ }
+
+ #endregion
+
+#if UNITY_5 || UNITY_2017_1_OR_NEWER
+ #region AudioMixer (Unity 5 or Newer)
+
+ /// Tweens an AudioMixer's exposed float to the given value.
+ /// Also stores the AudioMixer as the tween's target so it can be used for filtered operations.
+ /// Note that you need to manually expose a float in an AudioMixerGroup in order to be able to tween it from an AudioMixer.
+ /// Name given to the exposed float to set
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOSetFloat(this AudioMixer target, string floatName, float endValue, float duration)
+ {
+ return DOTween.To(()=> {
+ float currVal;
+ target.GetFloat(floatName, out currVal);
+ return currVal;
+ }, x=> target.SetFloat(floatName, x), endValue, duration)
+ .SetTarget(target);
+ }
+
+ #region Operation Shortcuts
+
+ ///
+ /// Completes all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens completed
+ /// (meaning the tweens that don't have infinite loops and were not already complete)
+ ///
+ /// For Sequences only: if TRUE also internal Sequence callbacks will be fired,
+ /// otherwise they will be ignored
+ public static int DOComplete(this AudioMixer target, bool withCallbacks = false)
+ {
+ return DOTween.Complete(target, withCallbacks);
+ }
+
+ ///
+ /// Kills all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens killed.
+ ///
+ /// If TRUE completes the tween before killing it
+ public static int DOKill(this AudioMixer target, bool complete = false)
+ {
+ return DOTween.Kill(target, complete);
+ }
+
+ ///
+ /// Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens flipped.
+ ///
+ public static int DOFlip(this AudioMixer target)
+ {
+ return DOTween.Flip(target);
+ }
+
+ ///
+ /// Sends to the given position all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens involved.
+ ///
+ /// Time position to reach
+ /// (if higher than the whole tween duration the tween will simply reach its end)
+ /// If TRUE will play the tween after reaching the given position, otherwise it will pause it
+ public static int DOGoto(this AudioMixer target, float to, bool andPlay = false)
+ {
+ return DOTween.Goto(target, to, andPlay);
+ }
+
+ ///
+ /// Pauses all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens paused.
+ ///
+ public static int DOPause(this AudioMixer target)
+ {
+ return DOTween.Pause(target);
+ }
+
+ ///
+ /// Plays all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens played.
+ ///
+ public static int DOPlay(this AudioMixer target)
+ {
+ return DOTween.Play(target);
+ }
+
+ ///
+ /// Plays backwards all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens played.
+ ///
+ public static int DOPlayBackwards(this AudioMixer target)
+ {
+ return DOTween.PlayBackwards(target);
+ }
+
+ ///
+ /// Plays forward all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens played.
+ ///
+ public static int DOPlayForward(this AudioMixer target)
+ {
+ return DOTween.PlayForward(target);
+ }
+
+ ///
+ /// Restarts all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens restarted.
+ ///
+ public static int DORestart(this AudioMixer target)
+ {
+ return DOTween.Restart(target);
+ }
+
+ ///
+ /// Rewinds all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens rewinded.
+ ///
+ public static int DORewind(this AudioMixer target)
+ {
+ return DOTween.Rewind(target);
+ }
+
+ ///
+ /// Smoothly rewinds all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens rewinded.
+ ///
+ public static int DOSmoothRewind(this AudioMixer target)
+ {
+ return DOTween.SmoothRewind(target);
+ }
+
+ ///
+ /// Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
+ /// (meaning tweens that were started from this target, or that had this target added as an Id)
+ /// and returns the total number of tweens involved.
+ ///
+ public static int DOTogglePause(this AudioMixer target)
+ {
+ return DOTween.TogglePause(target);
+ }
+
+ #endregion
+
+ #endregion
+#endif
+
+ #endregion
+ }
+}
+#endif
diff --git a/_DOTween.Assembly/bin/Modules/DOTweenModulePhysics.cs b/_DOTween.Assembly/bin/Modules/DOTweenModulePhysics.cs
new file mode 100644
index 0000000..dca71a0
--- /dev/null
+++ b/_DOTween.Assembly/bin/Modules/DOTweenModulePhysics.cs
@@ -0,0 +1,212 @@
+// Author: Daniele Giardini - http://www.demigiant.com
+// Created: 2018/07/13
+
+#if DOTPHYSICS
+using System;
+using DG.Tweening.Core;
+using DG.Tweening.Core.Enums;
+using DG.Tweening.Plugins;
+using DG.Tweening.Plugins.Core.PathCore;
+using DG.Tweening.Plugins.Options;
+using UnityEngine;
+
+#pragma warning disable 1591
+namespace DG.Tweening
+{
+ public static class DOTweenModulePhysics
+ {
+ #region Shortcuts
+
+ #region Rigidbody
+
+ /// Tweens a Rigidbody's position to the given value.
+ /// Also stores the rigidbody as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOMove(this Rigidbody target, Vector3 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.position, target.MovePosition, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ /// Tweens a Rigidbody's X position to the given value.
+ /// Also stores the rigidbody as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOMoveX(this Rigidbody target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue, 0, 0), duration)
+ .SetOptions(AxisConstraint.X, snapping).SetTarget(target);
+ }
+
+ /// Tweens a Rigidbody's Y position to the given value.
+ /// Also stores the rigidbody as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOMoveY(this Rigidbody target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.position, target.MovePosition, new Vector3(0, endValue, 0), duration)
+ .SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
+ }
+
+ /// Tweens a Rigidbody's Z position to the given value.
+ /// Also stores the rigidbody as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOMoveZ(this Rigidbody target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.position, target.MovePosition, new Vector3(0, 0, endValue), duration)
+ .SetOptions(AxisConstraint.Z, snapping).SetTarget(target);
+ }
+
+ /// Tweens a Rigidbody's rotation to the given value.
+ /// Also stores the rigidbody as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// Rotation mode
+ public static Tweener DORotate(this Rigidbody target, Vector3 endValue, float duration, RotateMode mode = RotateMode.Fast)
+ {
+ TweenerCore t = DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration);
+ t.SetTarget(target);
+ t.plugOptions.rotateMode = mode;
+ return t;
+ }
+
+ /// Tweens a Rigidbody's rotation so that it will look towards the given position.
+ /// Also stores the rigidbody as the tween's target so it can be used for filtered operations
+ /// The position to look atThe duration of the tween
+ /// Eventual axis constraint for the rotation
+ /// The vector that defines in which direction up is (default: Vector3.up)
+ public static Tweener DOLookAt(this Rigidbody target, Vector3 towards, float duration, AxisConstraint axisConstraint = AxisConstraint.None, Vector3? up = null)
+ {
+ TweenerCore t = DOTween.To(() => target.rotation, target.MoveRotation, towards, duration)
+ .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetLookAt);
+ t.plugOptions.axisConstraint = axisConstraint;
+ t.plugOptions.up = (up == null) ? Vector3.up : (Vector3)up;
+ return t;
+ }
+
+ #region Special
+
+ /// Tweens a Rigidbody's position to the given value, while also applying a jump effect along the Y axis.
+ /// Returns a Sequence instead of a Tweener.
+ /// Also stores the Rigidbody as the tween's target so it can be used for filtered operations
+ /// The end value to reach
+ /// Power of the jump (the max height of the jump is represented by this plus the final Y offset)
+ /// Total number of jumps
+ /// The duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Sequence DOJump(this Rigidbody target, Vector3 endValue, float jumpPower, int numJumps, float duration, bool snapping = false)
+ {
+ if (numJumps < 1) numJumps = 1;
+ float startPosY = 0;
+ float offsetY = -1;
+ bool offsetYSet = false;
+ Sequence s = DOTween.Sequence();
+ Tween yTween = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, jumpPower, 0), duration / (numJumps * 2))
+ .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative()
+ .SetLoops(numJumps * 2, LoopType.Yoyo)
+ .OnStart(() => startPosY = target.position.y);
+ s.Append(DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue.x, 0, 0), duration)
+ .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
+ ).Join(DOTween.To(() => target.position, target.MovePosition, new Vector3(0, 0, endValue.z), duration)
+ .SetOptions(AxisConstraint.Z, snapping).SetEase(Ease.Linear)
+ ).Join(yTween)
+ .SetTarget(target).SetEase(DOTween.defaultEaseType);
+ yTween.OnUpdate(() => {
+ if (!offsetYSet) {
+ offsetYSet = true;
+ offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
+ }
+ Vector3 pos = target.position;
+ pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad);
+ target.MovePosition(pos);
+ });
+ return s;
+ }
+
+ /// Tweens a Rigidbody's position through the given path waypoints, using the chosen path algorithm.
+ /// Also stores the Rigidbody as the tween's target so it can be used for filtered operations.
+ /// NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.
+ /// BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug).
+ /// If you plan to publish there you should use a regular transform.DOPath.
+ /// The waypoints to go through
+ /// The duration of the tween
+ /// The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)
+ /// The path mode: 3D, side-scroller 2D, top-down 2D
+ /// The resolution of the path (useless in case of Linear paths): higher resolutions make for more detailed curved paths but are more expensive.
+ /// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints
+ /// The color of the path (shown when gizmos are active in the Play panel and the tween is running)
+ public static TweenerCore DOPath(
+ this Rigidbody target, Vector3[] path, float duration, PathType pathType = PathType.Linear,
+ PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null
+ )
+ {
+ if (resolution < 1) resolution = 1;
+ TweenerCore t = DOTween.To(PathPlugin.Get(), () => target.position, target.MovePosition, new Path(pathType, path, resolution, gizmoColor), duration)
+ .SetTarget(target).SetUpdate(UpdateType.Fixed);
+
+ t.plugOptions.isRigidbody = true;
+ t.plugOptions.mode = pathMode;
+ return t;
+ }
+ /// Tweens a Rigidbody's localPosition through the given path waypoints, using the chosen path algorithm.
+ /// Also stores the Rigidbody as the tween's target so it can be used for filtered operations
+ /// NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.
+ /// BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug).
+ /// If you plan to publish there you should use a regular transform.DOLocalPath.
+ /// The waypoint to go through
+ /// The duration of the tween
+ /// The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)
+ /// The path mode: 3D, side-scroller 2D, top-down 2D
+ /// The resolution of the path: higher resolutions make for more detailed curved paths but are more expensive.
+ /// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints
+ /// The color of the path (shown when gizmos are active in the Play panel and the tween is running)
+ public static TweenerCore DOLocalPath(
+ this Rigidbody target, Vector3[] path, float duration, PathType pathType = PathType.Linear,
+ PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null
+ )
+ {
+ if (resolution < 1) resolution = 1;
+ Transform trans = target.transform;
+ TweenerCore t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), new Path(pathType, path, resolution, gizmoColor), duration)
+ .SetTarget(target).SetUpdate(UpdateType.Fixed);
+
+ t.plugOptions.isRigidbody = true;
+ t.plugOptions.mode = pathMode;
+ t.plugOptions.useLocalPosition = true;
+ return t;
+ }
+ // Used by path editor when creating the actual tween, so it can pass a pre-compiled path
+ internal static TweenerCore DOPath(
+ this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D
+ )
+ {
+ TweenerCore t = DOTween.To(PathPlugin.Get(), () => target.position, target.MovePosition, path, duration)
+ .SetTarget(target);
+
+ t.plugOptions.isRigidbody = true;
+ t.plugOptions.mode = pathMode;
+ return t;
+ }
+ internal static TweenerCore DOLocalPath(
+ this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D
+ )
+ {
+ Transform trans = target.transform;
+ TweenerCore t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), path, duration)
+ .SetTarget(target);
+
+ t.plugOptions.isRigidbody = true;
+ t.plugOptions.mode = pathMode;
+ t.plugOptions.useLocalPosition = true;
+ return t;
+ }
+
+ #endregion
+
+ #endregion
+
+ #endregion
+ }
+}
+#endif
diff --git a/_DOTween.Assembly/bin/Modules/DOTweenModulePhysics2D.cs b/_DOTween.Assembly/bin/Modules/DOTweenModulePhysics2D.cs
new file mode 100644
index 0000000..ba8625f
--- /dev/null
+++ b/_DOTween.Assembly/bin/Modules/DOTweenModulePhysics2D.cs
@@ -0,0 +1,101 @@
+// Author: Daniele Giardini - http://www.demigiant.com
+// Created: 2018/07/13
+
+#if DOTPHYSICS2D && (UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER)
+using System;
+using UnityEngine;
+
+#pragma warning disable 1591
+namespace DG.Tweening
+{
+ public static class DOTweenModulePhysics2D
+ {
+ #region Shortcuts
+
+ #region Rigidbody2D Shortcuts
+
+ /// Tweens a Rigidbody2D's position to the given value.
+ /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOMove(this Rigidbody2D target, Vector2 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.position, target.MovePosition, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ /// Tweens a Rigidbody2D's X position to the given value.
+ /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOMoveX(this Rigidbody2D target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.position, target.MovePosition, new Vector2(endValue, 0), duration)
+ .SetOptions(AxisConstraint.X, snapping).SetTarget(target);
+ }
+
+ /// Tweens a Rigidbody2D's Y position to the given value.
+ /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOMoveY(this Rigidbody2D target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.position, target.MovePosition, new Vector2(0, endValue), duration)
+ .SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
+ }
+
+ /// Tweens a Rigidbody2D's rotation to the given value.
+ /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DORotate(this Rigidbody2D target, float endValue, float duration)
+ {
+ return DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration)
+ .SetTarget(target);
+ }
+
+ #region Special
+
+ /// Tweens a Rigidbody2D's position to the given value, while also applying a jump effect along the Y axis.
+ /// Returns a Sequence instead of a Tweener.
+ /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations.
+ /// IMPORTANT: a rigidbody2D can't be animated in a jump arc using MovePosition, so the tween will directly set the position
+ /// The end value to reach
+ /// Power of the jump (the max height of the jump is represented by this plus the final Y offset)
+ /// Total number of jumps
+ /// The duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Sequence DOJump(this Rigidbody2D target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false)
+ {
+ if (numJumps < 1) numJumps = 1;
+ float startPosY = 0;
+ float offsetY = -1;
+ bool offsetYSet = false;
+ Sequence s = DOTween.Sequence();
+ Tween yTween = DOTween.To(() => target.position, x => target.position = x, new Vector2(0, jumpPower), duration / (numJumps * 2))
+ .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative()
+ .SetLoops(numJumps * 2, LoopType.Yoyo)
+ .OnStart(() => startPosY = target.position.y);
+ s.Append(DOTween.To(() => target.position, x => target.position = x, new Vector2(endValue.x, 0), duration)
+ .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
+ ).Join(yTween)
+ .SetTarget(target).SetEase(DOTween.defaultEaseType);
+ yTween.OnUpdate(() => {
+ if (!offsetYSet) {
+ offsetYSet = true;
+ offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
+ }
+ Vector3 pos = target.position;
+ pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad);
+ target.MovePosition(pos);
+ });
+ return s;
+ }
+
+ #endregion
+
+ #endregion
+
+ #endregion
+ }
+}
+#endif
diff --git a/_DOTween.Assembly/bin/Modules/DOTweenModuleSprite.cs b/_DOTween.Assembly/bin/Modules/DOTweenModuleSprite.cs
new file mode 100644
index 0000000..21f5d60
--- /dev/null
+++ b/_DOTween.Assembly/bin/Modules/DOTweenModuleSprite.cs
@@ -0,0 +1,88 @@
+// Author: Daniele Giardini - http://www.demigiant.com
+// Created: 2018/07/13
+
+#if DOTSPRITE && (UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER)
+using System;
+using UnityEngine;
+using DG.Tweening.Core;
+
+#pragma warning disable 1591
+namespace DG.Tweening
+{
+ public static class DOTweenModuleSprite
+ {
+ #region Shortcuts
+
+ #region SpriteRenderer
+
+ /// Tweens a SpriteRenderer's color to the given value.
+ /// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOColor(this SpriteRenderer target, Color endValue, float duration)
+ {
+ return DOTween.To(() => target.color, x => target.color = x, endValue, duration).SetTarget(target);
+ }
+
+ /// Tweens a Material's alpha color to the given value.
+ /// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOFade(this SpriteRenderer target, float endValue, float duration)
+ {
+ return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ /// Tweens a SpriteRenderer's color using the given gradient
+ /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
+ /// Also stores the image as the tween's target so it can be used for filtered operations
+ /// The gradient to useThe duration of the tween
+ public static Sequence DOGradientColor(this SpriteRenderer target, Gradient gradient, float duration)
+ {
+ Sequence s = DOTween.Sequence();
+ GradientColorKey[] colors = gradient.colorKeys;
+ int len = colors.Length;
+ for (int i = 0; i < len; ++i) {
+ GradientColorKey c = colors[i];
+ if (i == 0 && c.time <= 0) {
+ target.color = c.color;
+ continue;
+ }
+ float colorDuration = i == len - 1
+ ? duration - s.Duration(false) // Verifies that total duration is correct
+ : duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
+ s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
+ }
+ return s;
+ }
+
+ #endregion
+
+ #region Blendables
+
+ #region SpriteRenderer
+
+ /// Tweens a SpriteRenderer's color to the given value,
+ /// in a way that allows other DOBlendableColor tweens to work together on the same target,
+ /// instead than fight each other as multiple DOColor would do.
+ /// Also stores the SpriteRenderer as the tween's target so it can be used for filtered operations
+ /// The value to tween toThe duration of the tween
+ public static Tweener DOBlendableColor(this SpriteRenderer target, Color endValue, float duration)
+ {
+ endValue = endValue - target.color;
+ Color to = new Color(0, 0, 0, 0);
+ return DOTween.To(() => to, x => {
+ Color diff = x - to;
+ to = x;
+ target.color += diff;
+ }, endValue, duration)
+ .Blendable().SetTarget(target);
+ }
+
+ #endregion
+
+ #endregion
+
+ #endregion
+ }
+}
+#endif
diff --git a/_DOTween.Assembly/bin/Modules/DOTweenModuleUI.cs b/_DOTween.Assembly/bin/Modules/DOTweenModuleUI.cs
new file mode 100644
index 0000000..de800d5
--- /dev/null
+++ b/_DOTween.Assembly/bin/Modules/DOTweenModuleUI.cs
@@ -0,0 +1,570 @@
+// Author: Daniele Giardini - http://www.demigiant.com
+// Created: 2018/07/13
+
+#if DOTUI && (UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER)
+using System;
+using UnityEngine;
+using UnityEngine.UI;
+using DG.Tweening.Core;
+using DG.Tweening.Core.Enums;
+
+#pragma warning disable 1591
+namespace DG.Tweening
+{
+ public static class DOTweenModuleUI
+ {
+ #region Shortcuts
+
+ #region CanvasGroup
+
+ /// Tweens a CanvasGroup's alpha color to the given value.
+ /// Also stores the canvasGroup as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOFade(this CanvasGroup target, float endValue, float duration)
+ {
+ return DOTween.To(() => target.alpha, x => target.alpha = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ #endregion
+
+ #region Graphic
+
+ /// Tweens an Graphic's color to the given value.
+ /// Also stores the image as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOColor(this Graphic target, Color endValue, float duration)
+ {
+ return DOTween.To(() => target.color, x => target.color = x, endValue, duration).SetTarget(target);
+ }
+
+ /// Tweens an Graphic's alpha color to the given value.
+ /// Also stores the image as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOFade(this Graphic target, float endValue, float duration)
+ {
+ return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ #endregion
+
+ #region Image
+
+ /// Tweens an Image's color to the given value.
+ /// Also stores the image as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOColor(this Image target, Color endValue, float duration)
+ {
+ return DOTween.To(() => target.color, x => target.color = x, endValue, duration).SetTarget(target);
+ }
+
+ /// Tweens an Image's alpha color to the given value.
+ /// Also stores the image as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOFade(this Image target, float endValue, float duration)
+ {
+ return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ /// Tweens an Image's fillAmount to the given value.
+ /// Also stores the image as the tween's target so it can be used for filtered operations
+ /// The end value to reach (0 to 1)The duration of the tween
+ public static Tweener DOFillAmount(this Image target, float endValue, float duration)
+ {
+ if (endValue > 1) endValue = 1;
+ else if (endValue < 0) endValue = 0;
+ return DOTween.To(() => target.fillAmount, x => target.fillAmount = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ /// Tweens an Image's colors using the given gradient
+ /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
+ /// Also stores the image as the tween's target so it can be used for filtered operations
+ /// The gradient to useThe duration of the tween
+ public static Sequence DOGradientColor(this Image target, Gradient gradient, float duration)
+ {
+ Sequence s = DOTween.Sequence();
+ GradientColorKey[] colors = gradient.colorKeys;
+ int len = colors.Length;
+ for (int i = 0; i < len; ++i) {
+ GradientColorKey c = colors[i];
+ if (i == 0 && c.time <= 0) {
+ target.color = c.color;
+ continue;
+ }
+ float colorDuration = i == len - 1
+ ? duration - s.Duration(false) // Verifies that total duration is correct
+ : duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
+ s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
+ }
+ return s;
+ }
+
+ #endregion
+
+ #region LayoutElement
+
+ /// Tweens an LayoutElement's flexibleWidth/Height to the given value.
+ /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOFlexibleSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => new Vector2(target.flexibleWidth, target.flexibleHeight), x => {
+ target.flexibleWidth = x.x;
+ target.flexibleHeight = x.y;
+ }, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ /// Tweens an LayoutElement's minWidth/Height to the given value.
+ /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOMinSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => new Vector2(target.minWidth, target.minHeight), x => {
+ target.minWidth = x.x;
+ target.minHeight = x.y;
+ }, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ /// Tweens an LayoutElement's preferredWidth/Height to the given value.
+ /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOPreferredSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => new Vector2(target.preferredWidth, target.preferredHeight), x => {
+ target.preferredWidth = x.x;
+ target.preferredHeight = x.y;
+ }, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ #endregion
+
+ #region Outline
+
+ /// Tweens a Outline's effectColor to the given value.
+ /// Also stores the Outline as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOColor(this Outline target, Color endValue, float duration)
+ {
+ return DOTween.To(() => target.effectColor, x => target.effectColor = x, endValue, duration).SetTarget(target);
+ }
+
+ /// Tweens a Outline's effectColor alpha to the given value.
+ /// Also stores the Outline as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOFade(this Outline target, float endValue, float duration)
+ {
+ return DOTween.ToAlpha(() => target.effectColor, x => target.effectColor = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ /// Tweens a Outline's effectDistance to the given value.
+ /// Also stores the Outline as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOScale(this Outline target, Vector2 endValue, float duration)
+ {
+ return DOTween.To(() => target.effectDistance, x => target.effectDistance = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ #endregion
+
+ #region RectTransform
+
+ /// Tweens a RectTransform's anchoredPosition to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOAnchorPos(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+ /// Tweens a RectTransform's anchoredPosition X to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOAnchorPosX(this RectTransform target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(endValue, 0), duration)
+ .SetOptions(AxisConstraint.X, snapping).SetTarget(target);
+ }
+ /// Tweens a RectTransform's anchoredPosition Y to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOAnchorPosY(this RectTransform target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(0, endValue), duration)
+ .SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
+ }
+
+ /// Tweens a RectTransform's anchoredPosition3D to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOAnchorPos3D(this RectTransform target, Vector3 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+ /// Tweens a RectTransform's anchoredPosition3D X to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOAnchorPos3DX(this RectTransform target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(endValue, 0, 0), duration)
+ .SetOptions(AxisConstraint.X, snapping).SetTarget(target);
+ }
+ /// Tweens a RectTransform's anchoredPosition3D Y to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOAnchorPos3DY(this RectTransform target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(0, endValue, 0), duration)
+ .SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
+ }
+ /// Tweens a RectTransform's anchoredPosition3D Z to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOAnchorPos3DZ(this RectTransform target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(0, 0, endValue), duration)
+ .SetOptions(AxisConstraint.Z, snapping).SetTarget(target);
+ }
+
+ /// Tweens a RectTransform's anchorMax to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOAnchorMax(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.anchorMax, x => target.anchorMax = x, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ /// Tweens a RectTransform's anchorMin to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOAnchorMin(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.anchorMin, x => target.anchorMin = x, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ /// Tweens a RectTransform's pivot to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOPivot(this RectTransform target, Vector2 endValue, float duration)
+ {
+ return DOTween.To(() => target.pivot, x => target.pivot = x, endValue, duration)
+ .SetTarget(target);
+ }
+ /// Tweens a RectTransform's pivot X to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOPivotX(this RectTransform target, float endValue, float duration)
+ {
+ return DOTween.To(() => target.pivot, x => target.pivot = x, new Vector2(endValue, 0), duration)
+ .SetOptions(AxisConstraint.X).SetTarget(target);
+ }
+ /// Tweens a RectTransform's pivot Y to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOPivotY(this RectTransform target, float endValue, float duration)
+ {
+ return DOTween.To(() => target.pivot, x => target.pivot = x, new Vector2(0, endValue), duration)
+ .SetOptions(AxisConstraint.Y).SetTarget(target);
+ }
+
+ /// Tweens a RectTransform's sizeDelta to the given value.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOSizeDelta(this RectTransform target, Vector2 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.sizeDelta, x => target.sizeDelta = x, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ /// Punches a RectTransform's anchoredPosition towards the given direction and then back to the starting one
+ /// as if it was connected to the starting position via an elastic.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The direction and strength of the punch (added to the RectTransform's current position)
+ /// The duration of the tween
+ /// Indicates how much will the punch vibrate
+ /// Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards.
+ /// 1 creates a full oscillation between the punch direction and the opposite direction,
+ /// while 0 oscillates only between the punch and the start position
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOPunchAnchorPos(this RectTransform target, Vector2 punch, float duration, int vibrato = 10, float elasticity = 1, bool snapping = false)
+ {
+ return DOTween.Punch(() => target.anchoredPosition, x => target.anchoredPosition = x, punch, duration, vibrato, elasticity)
+ .SetTarget(target).SetOptions(snapping);
+ }
+
+ /// 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
+ /// The duration of the tween
+ /// The shake strength
+ /// Indicates how much will the shake vibrate
+ /// 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.
+ /// If TRUE the tween will smoothly snap all values to integers
+ /// If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not
+ public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, float strength = 100, 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, true, fadeOut)
+ .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping);
+ }
+ /// 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
+ /// The duration of the tween
+ /// The shake strength on each axis
+ /// Indicates how much will the shake vibrate
+ /// 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.
+ /// If TRUE the tween will smoothly snap all values to integers
+ /// If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not
+ 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);
+ }
+
+ #region Special
+
+ /// Tweens a RectTransform's anchoredPosition to the given value, while also applying a jump effect along the Y axis.
+ /// Returns a Sequence instead of a Tweener.
+ /// Also stores the RectTransform as the tween's target so it can be used for filtered operations
+ /// The end value to reach
+ /// Power of the jump (the max height of the jump is represented by this plus the final Y offset)
+ /// Total number of jumps
+ /// The duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Sequence DOJumpAnchorPos(this RectTransform target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false)
+ {
+ if (numJumps < 1) numJumps = 1;
+ float startPosY = 0;
+ float offsetY = -1;
+ bool offsetYSet = false;
+
+ // Separate Y Tween so we can elaborate elapsedPercentage on that insted of on the Sequence
+ // (in case users add a delay or other elements to the Sequence)
+ Sequence s = DOTween.Sequence();
+ Tween yTween = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(0, jumpPower), duration / (numJumps * 2))
+ .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative()
+ .SetLoops(numJumps * 2, LoopType.Yoyo)
+ .OnStart(()=> startPosY = target.anchoredPosition.y);
+ s.Append(DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(endValue.x, 0), duration)
+ .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
+ ).Join(yTween)
+ .SetTarget(target).SetEase(DOTween.defaultEaseType);
+ s.OnUpdate(() => {
+ if (!offsetYSet) {
+ offsetYSet = true;
+ offsetY = s.isRelative ? endValue.y : endValue.y - startPosY;
+ }
+ Vector2 pos = target.anchoredPosition;
+ pos.y += DOVirtual.EasedValue(0, offsetY, s.ElapsedDirectionalPercentage(), Ease.OutQuad);
+ target.anchoredPosition = pos;
+ });
+ return s;
+ }
+
+ #endregion
+
+ #endregion
+
+ #region ScrollRect
+
+ /// Tweens a ScrollRect's horizontal/verticalNormalizedPosition to the given value.
+ /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DONormalizedPos(this ScrollRect target, Vector2 endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => new Vector2(target.horizontalNormalizedPosition, target.verticalNormalizedPosition),
+ x => {
+ target.horizontalNormalizedPosition = x.x;
+ target.verticalNormalizedPosition = x.y;
+ }, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+ /// Tweens a ScrollRect's horizontalNormalizedPosition to the given value.
+ /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOHorizontalNormalizedPos(this ScrollRect target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.horizontalNormalizedPosition, x => target.horizontalNormalizedPosition = x, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+ /// Tweens a ScrollRect's verticalNormalizedPosition to the given value.
+ /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOVerticalNormalizedPos(this ScrollRect target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.verticalNormalizedPosition, x => target.verticalNormalizedPosition = x, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ #endregion
+
+ #region Slider
+
+ /// Tweens a Slider's value to the given value.
+ /// Also stores the Slider as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ /// If TRUE the tween will smoothly snap all values to integers
+ public static Tweener DOValue(this Slider target, float endValue, float duration, bool snapping = false)
+ {
+ return DOTween.To(() => target.value, x => target.value = x, endValue, duration)
+ .SetOptions(snapping).SetTarget(target);
+ }
+
+ #endregion
+
+ #region Text
+
+ /// Tweens a Text's color to the given value.
+ /// Also stores the Text as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOColor(this Text target, Color endValue, float duration)
+ {
+ return DOTween.To(() => target.color, x => target.color = x, endValue, duration).SetTarget(target);
+ }
+
+ /// Tweens a Text's alpha color to the given value.
+ /// Also stores the Text as the tween's target so it can be used for filtered operations
+ /// The end value to reachThe duration of the tween
+ public static Tweener DOFade(this Text target, float endValue, float duration)
+ {
+ return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration)
+ .SetTarget(target);
+ }
+
+ /// Tweens a Text's text to the given value.
+ /// Also stores the Text as the tween's target so it can be used for filtered operations
+ /// The end string to tween toThe duration of the tween
+ /// If TRUE (default), rich text will be interpreted correctly while animated,
+ /// otherwise all tags will be considered as normal text
+ /// The type of scramble mode to use, if any
+ /// 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
+ public static Tweener DOText(this Text 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
+
+ #region Blendables
+
+ #region Graphic
+
+ /// Tweens a Graphic's color to the given value,
+ /// in a way that allows other DOBlendableColor tweens to work together on the same target,
+ /// instead than fight each other as multiple DOColor would do.
+ /// Also stores the Graphic as the tween's target so it can be used for filtered operations
+ /// The value to tween toThe duration of the tween
+ public static Tweener DOBlendableColor(this Graphic target, Color endValue, float duration)
+ {
+ endValue = endValue - target.color;
+ Color to = new Color(0, 0, 0, 0);
+ return DOTween.To(() => to, x => {
+ Color diff = x - to;
+ to = x;
+ target.color += diff;
+ }, endValue, duration)
+ .Blendable().SetTarget(target);
+ }
+
+ #endregion
+
+ #region Image
+
+ /// Tweens a Image's color to the given value,
+ /// in a way that allows other DOBlendableColor tweens to work together on the same target,
+ /// instead than fight each other as multiple DOColor would do.
+ /// Also stores the Image as the tween's target so it can be used for filtered operations
+ /// The value to tween toThe duration of the tween
+ public static Tweener DOBlendableColor(this Image target, Color endValue, float duration)
+ {
+ endValue = endValue - target.color;
+ Color to = new Color(0, 0, 0, 0);
+ return DOTween.To(() => to, x => {
+ Color diff = x - to;
+ to = x;
+ target.color += diff;
+ }, endValue, duration)
+ .Blendable().SetTarget(target);
+ }
+
+ #endregion
+
+ #region Text
+
+ /// Tweens a Text's color BY the given value,
+ /// in a way that allows other DOBlendableColor tweens to work together on the same target,
+ /// instead than fight each other as multiple DOColor would do.
+ /// Also stores the Text as the tween's target so it can be used for filtered operations
+ /// The value to tween toThe duration of the tween
+ public static Tweener DOBlendableColor(this Text target, Color endValue, float duration)
+ {
+ endValue = endValue - target.color;
+ Color to = new Color(0, 0, 0, 0);
+ return DOTween.To(() => to, x => {
+ Color diff = x - to;
+ to = x;
+ target.color += diff;
+ }, endValue, duration)
+ .Blendable().SetTarget(target);
+ }
+
+ #endregion
+
+ #endregion
+
+ #endregion
+
+ // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
+ // ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████
+ // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
+
+ public static class Utils
+ {
+ ///
+ /// Converts the anchoredPosition of the first RectTransform to the second RectTransform,
+ /// taking into consideration offset, anchors and pivot, and returns the new anchoredPosition
+ ///
+ public static Vector2 SwitchToRectTransform(RectTransform from, RectTransform to)
+ {
+ Vector2 localPoint;
+ Vector2 fromPivotDerivedOffset = new Vector2(from.rect.width * 0.5f + from.rect.xMin, from.rect.height * 0.5f + from.rect.yMin);
+ Vector2 screenP = RectTransformUtility.WorldToScreenPoint(null, from.position);
+ screenP += fromPivotDerivedOffset;
+ RectTransformUtility.ScreenPointToLocalPointInRectangle(to, screenP, null, out localPoint);
+ Vector2 pivotDerivedOffset = new Vector2(to.rect.width * 0.5f + to.rect.xMin, to.rect.height * 0.5f + to.rect.yMin);
+ return to.anchoredPosition + localPoint - pivotDerivedOffset;
+ }
+ }
+ }
+}
+#endif
diff --git a/_DOTween.Assembly/bin/Modules/DOTweenModuleUnityVersion.cs b/_DOTween.Assembly/bin/Modules/DOTweenModuleUnityVersion.cs
new file mode 100644
index 0000000..751a0a7
--- /dev/null
+++ b/_DOTween.Assembly/bin/Modules/DOTweenModuleUnityVersion.cs
@@ -0,0 +1,252 @@
+// Author: Daniele Giardini - http://www.demigiant.com
+// Created: 2018/07/13
+
+using System;
+using UnityEngine;
+using DG.Tweening.Core;
+
+#pragma warning disable 1591
+namespace DG.Tweening
+{
+ ///
+ /// Shortcuts/functions that are not strictly related to specific Modules
+ /// but are available only on some Unity versions
+ ///
+ public static class DOTweenModuleUnityVersion
+ {
+#if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER
+ #region Unity 4.3 or Newer
+
+ #region Material
+
+ /// Tweens a Material's color using the given gradient
+ /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
+ /// Also stores the image as the tween's target so it can be used for filtered operations
+ /// The gradient to useThe duration of the tween
+ public static Sequence DOGradientColor(this Material target, Gradient gradient, float duration)
+ {
+ Sequence s = DOTween.Sequence();
+ GradientColorKey[] colors = gradient.colorKeys;
+ int len = colors.Length;
+ for (int i = 0; i < len; ++i) {
+ GradientColorKey c = colors[i];
+ if (i == 0 && c.time <= 0) {
+ target.color = c.color;
+ continue;
+ }
+ float colorDuration = i == len - 1
+ ? duration - s.Duration(false) // Verifies that total duration is correct
+ : duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
+ s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear));
+ }
+ return s;
+ }
+ /// Tweens a Material's named color property using the given gradient
+ /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener).
+ /// Also stores the image as the tween's target so it can be used for filtered operations
+ /// The gradient to use
+ /// The name of the material property to tween (like _Tint or _SpecColor)
+ /// The duration of the tween
+ public static Sequence DOGradientColor(this Material target, Gradient gradient, string property, float duration)
+ {
+ Sequence s = DOTween.Sequence();
+ GradientColorKey[] colors = gradient.colorKeys;
+ int len = colors.Length;
+ for (int i = 0; i < len; ++i) {
+ GradientColorKey c = colors[i];
+ if (i == 0 && c.time <= 0) {
+ target.color = c.color;
+ continue;
+ }
+ float colorDuration = i == len - 1
+ ? duration - s.Duration(false) // Verifies that total duration is correct
+ : duration * (i == 0 ? c.time : c.time - colors[i - 1].time);
+ s.Append(target.DOColor(c.color, property, colorDuration).SetEase(Ease.Linear));
+ }
+ return s;
+ }
+
+ #endregion
+
+ #endregion
+#endif
+
+#if UNITY_5_3_OR_NEWER || UNITY_2017_1_OR_NEWER
+ #region CustomYieldInstructions (Unity 5.3 or Newer)
+
+ ///
+ /// Returns a that waits until the tween is killed or complete.
+ /// It can be used inside a coroutine as a yield.
+ /// Example usage:yield return myTween.WaitForCompletion(true);
+ ///
+ public static CustomYieldInstruction WaitForCompletion(this Tween t, bool returnCustomYieldInstruction)
+ {
+ if (!t.active) {
+ if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
+ return null;
+ }
+ return new DOTweenCYInstruction.WaitForCompletion(t);
+ }
+
+ ///
+ /// Returns a that waits until the tween is killed or rewinded.
+ /// It can be used inside a coroutine as a yield.
+ /// Example usage:yield return myTween.WaitForRewind();
+ ///
+ public static CustomYieldInstruction WaitForRewind(this Tween t, bool returnCustomYieldInstruction)
+ {
+ if (!t.active) {
+ if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
+ return null;
+ }
+ return new DOTweenCYInstruction.WaitForRewind(t);
+ }
+
+ ///
+ /// Returns a that waits until the tween is killed.
+ /// It can be used inside a coroutine as a yield.
+ /// Example usage:yield return myTween.WaitForKill();
+ ///
+ public static CustomYieldInstruction WaitForKill(this Tween t, bool returnCustomYieldInstruction)
+ {
+ if (!t.active) {
+ if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
+ return null;
+ }
+ return new DOTweenCYInstruction.WaitForKill(t);
+ }
+
+ ///
+ /// Returns a that waits until the tween is killed or has gone through the given amount of loops.
+ /// It can be used inside a coroutine as a yield.
+ /// Example usage:yield return myTween.WaitForElapsedLoops(2);
+ ///
+ /// Elapsed loops to wait for
+ public static CustomYieldInstruction WaitForElapsedLoops(this Tween t, int elapsedLoops, bool returnCustomYieldInstruction)
+ {
+ if (!t.active) {
+ if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
+ return null;
+ }
+ return new DOTweenCYInstruction.WaitForElapsedLoops(t, elapsedLoops);
+ }
+
+ ///
+ /// Returns a that waits until the tween is killed or has reached the given position (loops included, delays excluded).
+ /// It can be used inside a coroutine as a yield.
+ /// Example usage:yield return myTween.WaitForPosition(2.5f);
+ ///
+ /// Position (loops included, delays excluded) to wait for
+ public static CustomYieldInstruction WaitForPosition(this Tween t, float position, bool returnCustomYieldInstruction)
+ {
+ if (!t.active) {
+ if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
+ return null;
+ }
+ return new DOTweenCYInstruction.WaitForPosition(t, position);
+ }
+
+ ///
+ /// Returns a that waits until the tween is killed or started
+ /// (meaning when the tween is set in a playing state the first time, after any eventual delay).
+ /// It can be used inside a coroutine as a yield.
+ /// Example usage:yield return myTween.WaitForStart();
+ ///
+ public static CustomYieldInstruction WaitForStart(this Tween t, bool returnCustomYieldInstruction)
+ {
+ if (!t.active) {
+ if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
+ return null;
+ }
+ return new DOTweenCYInstruction.WaitForStart(t);
+ }
+
+ #endregion
+#endif
+ }
+
+ // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
+ // ███ CLASSES █████████████████████████████████████████████████████████████████████████████████████████████████████████
+ // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
+
+#if UNITY_5_3_OR_NEWER || UNITY_2017_1_OR_NEWER
+ public static class DOTweenCYInstruction
+ {
+ public class WaitForCompletion : CustomYieldInstruction
+ {
+ public override bool keepWaiting { get {
+ return t.active && !t.IsComplete();
+ }}
+ readonly Tween t;
+ public WaitForCompletion(Tween tween)
+ {
+ t = tween;
+ }
+ }
+
+ public class WaitForRewind : CustomYieldInstruction
+ {
+ public override bool keepWaiting { get {
+ return t.active && (!t.playedOnce || t.position * (t.CompletedLoops() + 1) > 0);
+ }}
+ readonly Tween t;
+ public WaitForRewind(Tween tween)
+ {
+ t = tween;
+ }
+ }
+
+ public class WaitForKill : CustomYieldInstruction
+ {
+ public override bool keepWaiting { get {
+ return t.active;
+ }}
+ readonly Tween t;
+ public WaitForKill(Tween tween)
+ {
+ t = tween;
+ }
+ }
+
+ public class WaitForElapsedLoops : CustomYieldInstruction
+ {
+ public override bool keepWaiting { get {
+ return t.active && t.CompletedLoops() < elapsedLoops;
+ }}
+ readonly Tween t;
+ readonly int elapsedLoops;
+ public WaitForElapsedLoops(Tween tween, int elapsedLoops)
+ {
+ t = tween;
+ this.elapsedLoops = elapsedLoops;
+ }
+ }
+
+ public class WaitForPosition : CustomYieldInstruction
+ {
+ public override bool keepWaiting { get {
+ return t.active && t.position * (t.CompletedLoops() + 1) < position;
+ }}
+ readonly Tween t;
+ readonly float position;
+ public WaitForPosition(Tween tween, float position)
+ {
+ t = tween;
+ this.position = position;
+ }
+ }
+
+ public class WaitForStart : CustomYieldInstruction
+ {
+ public override bool keepWaiting { get {
+ return t.active && !t.playedOnce;
+ }}
+ readonly Tween t;
+ public WaitForStart(Tween tween)
+ {
+ t = tween;
+ }
+ }
+ }
+#endif
+}
diff --git a/_DOTween.Assembly/bin/Modules/DOTweenModuleUtils.cs b/_DOTween.Assembly/bin/Modules/DOTweenModuleUtils.cs
new file mode 100644
index 0000000..a768721
--- /dev/null
+++ b/_DOTween.Assembly/bin/Modules/DOTweenModuleUtils.cs
@@ -0,0 +1,108 @@
+// Author: Daniele Giardini - http://www.demigiant.com
+// Created: 2018/07/13
+
+using System;
+using UnityEngine;
+using DG.Tweening.Core;
+using DG.Tweening.Plugins.Core.PathCore;
+using DG.Tweening.Plugins.Options;
+
+#pragma warning disable 1591
+namespace DG.Tweening
+{
+ ///
+ /// Utility functions that deal with available Modules.
+ /// Modules defines:
+ /// - DOTAUDIO
+ /// - DOTPHYSICS
+ /// - DOTPHYSICS2D
+ /// - DOTSPRITE
+ /// - DOTUI
+ /// Extra defines set and used for implementation of external assets:
+ /// - DOTWEEN_TMP ► TextMesh Pro
+ /// - DOTWEEN_TK2D ► 2D Toolkit
+ ///
+ public static class DOTweenModuleUtils
+ {
+ static bool _initialized;
+
+ ///
+ /// Called via Reflection by DOTweenComponent on Awake
+ ///
+ public static void Init()
+ {
+ if (_initialized) return;
+
+ _initialized = true;
+ DOTweenExternalCommand.SetOrientationOnPath += Physics.SetOrientationOnPath;
+ }
+
+ // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
+ // ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████
+ // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
+
+ public static class Physics
+ {
+ // Called via DOTweenExternalCommand callback
+ public static void SetOrientationOnPath(PathOptions options, Tween t, Quaternion newRot, Transform trans)
+ {
+#if DOTPHYSICS
+ if (options.isRigidbody) ((Rigidbody)t.target).rotation = newRot;
+ else trans.rotation = newRot;
+#else
+ trans.rotation = newRot;
+#endif
+ }
+
+ // Returns FALSE if the DOTween's Physics2D Module is disabled, or if there's no Rigidbody2D attached
+ public static bool HasRigidbody2D(Component target)
+ {
+#if DOTPHYSICS2D
+ return target.GetComponent() != null;
+#else
+ return false;
+#endif
+ }
+
+ #region Called via Reflection
+
+
+ // Called via Reflection by DOTweenPathInspector
+ // Returns FALSE if the DOTween's Physics Module is disabled, or if there's no rigidbody attached
+ public static bool HasRigidbody(Component target)
+ {
+#if DOTPHYSICS
+ return target.GetComponent() != null;
+#else
+ return false;
+#endif
+ }
+
+ // Called via Reflection by DOTweenPath
+ public static TweenerCore CreateDOTweenPathTween(
+ MonoBehaviour target, bool tweenRigidbody, bool isLocal, Path path, float duration, PathMode pathMode
+ ){
+ TweenerCore t;
+#if DOTPHYSICS
+ Rigidbody rBody = tweenRigidbody ? target.GetComponent() : null;
+ if (tweenRigidbody && rBody != null) {
+ t = isLocal
+ ? rBody.DOLocalPath(path, duration, pathMode)
+ : rBody.DOPath(path, duration, pathMode);
+ } else {
+ t = isLocal
+ ? target.transform.DOLocalPath(path, duration, pathMode)
+ : target.transform.DOPath(path, duration, pathMode);
+ }
+#else
+ t = isLocal
+ ? target.transform.DOLocalPath(path, duration, pathMode)
+ : target.transform.DOPath(path, duration, pathMode);
+#endif
+ return t;
+ }
+
+ #endregion
+ }
+ }
+}
diff --git a/_DOTween.Assembly/bin/readme.txt b/_DOTween.Assembly/bin/readme.txt
index 3439db1..aa60e6f 100644
--- a/_DOTween.Assembly/bin/readme.txt
+++ b/_DOTween.Assembly/bin/readme.txt
@@ -1,8 +1,17 @@
DOTween and DOTween Pro are copyright (c) 2014 Daniele Giardini - Demigiant
+// IMPORTANT!!! /////////////////////////////////////////////
+// Upgrading DOTween from versions older than 1.2.000 ///////
+-------------------------------------------------------------
+If you're upgrading your project from a version of DOTween older than 1.2.000 (or DOTween Pro older than 1.0.000) please follow these instructions carefully.
+1) Import the new version in the same folder as the previous one, overwriting old files. A lot of errors will appear but don't worry
+2) Close and reopen Unity (and your project). This is fundamental: skipping this step will cause a bloodbath
+3) Open DOTween's Utility Panel (Tools > Demigiant > DOTween Utility Panel) if it doesn't open automatically, then press "Setup DOTween...": this will run the upgrade setup
+4) From the Add/Remove Modules panel that opens, activate all Modules for the tweens you were using (all of them, probably)
+
// GET STARTED //////////////////////////////////////////////
-- After importing a new DOTween update, select DOTween's Utility Panel from the Tools menu (if it doesn't open automatically) and press the "Setup DOTween..." button to set up additional features based on your Unity version.
+- After importing a new DOTween update, select DOTween's Utility Panel from the "Tools/Demigiant" menu (if it doesn't open automatically) and press the "Setup DOTween..." button to activate/deactivate Modules. You can also access a Preferences Tab from there to choose default settings for DOTween.
- In your code, add "using DG.Tweening" to each class where you want to use DOTween.
- You're ready to tween. Check out the links below for full documentation and license info.
@@ -12,7 +21,8 @@ DOTween and DOTween Pro are copyright (c) 2014 Daniele Giardini - Demigiant
DOTween website (documentation, examples, etc): http://dotween.demigiant.com
DOTween license: http://dotween.demigiant.com/license.php
DOTween repository (Google Code): https://code.google.com/p/dotween/
+Demigiant website (documentation, examples, etc): http://www.demigiant.com
// NOTES //////////////////////////////////////////////////////
-- DOTween's Utility Panel can be found under "Tools > DOTween Utility Panel" and also contains other useful options, plus a tab to set DOTween's preferences
\ No newline at end of file
+- DOTween's Utility Panel can be found under "Tools > Demigiant > DOTween Utility Panel" and also contains other useful options, plus a tab to set DOTween's preferences
\ No newline at end of file