1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2026-02-04 14:24:55 +08:00

Merge branch 'feature/000_modules_implementation' into develop

This commit is contained in:
Demigiant 2018-08-01 10:28:01 +02:00
commit 28d68f62bc
105 changed files with 4627 additions and 2187 deletions

4
.gitignore vendored
View File

@ -34,6 +34,10 @@ zz UnityTests*
zzTestBuilds zzTestBuilds
*.tmp *.tmp
*.pdb *.pdb
*.DotSettings
UnityTests.Unity5BETA UnityTests.Unity5BETA
UnityTests.Unity5 - LastVersionBeforeModules
ModulesTest.Unity2018
biz biz
zzTemp

View File

@ -179,6 +179,26 @@
Public only so custom shortcuts can access some of these methods Public only so custom shortcuts can access some of these methods
</summary> </summary>
</member> </member>
<member name="M:DG.Tweening.Core.Extensions.SetSpecialStartupMode``1(``0,DG.Tweening.Core.Enums.SpecialStartupMode)">
<summary>
INTERNAL: used by DO shortcuts and Modules to set special startup mode
</summary>
</member>
<member name="M:DG.Tweening.Core.Extensions.Blendable``3(DG.Tweening.Core.TweenerCore{``0,``1,``2})">
<summary>
INTERNAL: used by DO shortcuts and Modules to set the tween as blendable
</summary>
</member>
<member name="M:DG.Tweening.Core.Extensions.NoFrom``3(DG.Tweening.Core.TweenerCore{``0,``1,``2})">
<summary>
INTERNAL: used by DO shortcuts and Modules to prevent a tween from using a From setup even if passed
</summary>
</member>
<member name="T:DG.Tweening.Core.DOTweenExternalCommand">
<summary>
Used to dispatch commands that need to be captured externally, usually by Modules
</summary>
</member>
<member name="M:DG.Tweening.Core.Utils.Vector3FromAngle(System.Single,System.Single)"> <member name="M:DG.Tweening.Core.Utils.Vector3FromAngle(System.Single,System.Single)">
<summary> <summary>
Returns a Vector3 with z = 0 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. because the latter fails (in some cases) when assigning a Vector3 to a transform.position and then checking it.
</summary> </summary>
</member> </member>
<member name="M:DG.Tweening.Core.Utils.GetLooseScriptType(System.String)">
<summary>
Looks for the type withing all possible project assembly names
</summary>
</member>
<member name="T:DG.Tweening.Color2"> <member name="T:DG.Tweening.Color2">
<summary> <summary>
Struct that stores two colors (used for LineRenderer tweens) 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 Methods that extend known Unity objects and allow to directly create and control tweens from their instances
</summary> </summary>
</member> </member>
<member name="M:DG.Tweening.ShortcutExtensions.DOFade(UnityEngine.AudioSource,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach (0 to 1)</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOPitch(UnityEngine.AudioSource,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOAspect(UnityEngine.Camera,System.Single,System.Single)"> <member name="M:DG.Tweening.ShortcutExtensions.DOAspect(UnityEngine.Camera,System.Single,System.Single)">
<summary>Tweens a Camera's <code>aspect</code> to the given value. <summary>Tweens a Camera's <code>aspect</code> to the given value.
Also stores the camera as the tween's target so it can be used for filtered operations</summary> Also stores the camera as the tween's target so it can be used for filtered operations</summary>
@ -1418,81 +1433,6 @@
<param name="property">The name of the material property to tween</param> <param name="property">The name of the material property to tween</param>
<param name="duration">The duration of the tween</param> <param name="duration">The duration of the tween</param>
</member> </member>
<member name="M:DG.Tweening.ShortcutExtensions.DOMove(UnityEngine.Rigidbody,UnityEngine.Vector3,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOMoveX(UnityEngine.Rigidbody,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOMoveY(UnityEngine.Rigidbody,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOMoveZ(UnityEngine.Rigidbody,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DORotate(UnityEngine.Rigidbody,UnityEngine.Vector3,System.Single,DG.Tweening.RotateMode)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="mode">Rotation mode</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOLookAt(UnityEngine.Rigidbody,UnityEngine.Vector3,System.Single,DG.Tweening.AxisConstraint,System.Nullable{UnityEngine.Vector3})">
<summary>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</summary>
<param name="towards">The position to look at</param><param name="duration">The duration of the tween</param>
<param name="axisConstraint">Eventual axis constraint for the rotation</param>
<param name="up">The vector that defines in which direction up is (default: Vector3.up)</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOJump(UnityEngine.Rigidbody,UnityEngine.Vector3,System.Single,System.Int32,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param>
<param name="jumpPower">Power of the jump (the max height of the jump is represented by this plus the final Y offset)</param>
<param name="numJumps">Total number of jumps</param>
<param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOPath(UnityEngine.Rigidbody,UnityEngine.Vector3[],System.Single,DG.Tweening.PathType,DG.Tweening.PathMode,System.Int32,System.Nullable{UnityEngine.Color})">
<summary>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.
<para>NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.</para>
<para>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.</para></summary>
<param name="path">The waypoints to go through</param>
<param name="duration">The duration of the tween</param>
<param name="pathType">The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)</param>
<param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
<param name="resolution">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</param>
<param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOLocalPath(UnityEngine.Rigidbody,UnityEngine.Vector3[],System.Single,DG.Tweening.PathType,DG.Tweening.PathMode,System.Int32,System.Nullable{UnityEngine.Color})">
<summary>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
<para>NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.</para>
<para>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.</para></summary>
<param name="path">The waypoint to go through</param>
<param name="duration">The duration of the tween</param>
<param name="pathType">The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)</param>
<param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
<param name="resolution">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</param>
<param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOResize(UnityEngine.TrailRenderer,System.Single,System.Single,System.Single)"> <member name="M:DG.Tweening.ShortcutExtensions.DOResize(UnityEngine.TrailRenderer,System.Single,System.Single,System.Single)">
<summary>Tweens a TrailRenderer's startWidth/endWidth to the given value. <summary>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</summary> Also stores the TrailRenderer as the tween's target so it can be used for filtered operations</summary>
@ -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</param> Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints</param>
<param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param> <param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
</member> </member>
<member name="M:DG.Tweening.ShortcutExtensions.DOPath(UnityEngine.Transform,DG.Tweening.Plugins.Core.PathCore.Path,System.Single,DG.Tweening.PathMode)">
<summary>IMPORTANT: Unless you really know what you're doing, you should use the overload that accepts a Vector3 array instead.<para/>
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</summary>
<param name="path">The path to use</param>
<param name="duration">The duration of the tween</param>
<param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOLocalPath(UnityEngine.Transform,DG.Tweening.Plugins.Core.PathCore.Path,System.Single,DG.Tweening.PathMode)">
<summary>IMPORTANT: Unless you really know what you're doing, you should use the overload that accepts a Vector3 array instead.<para/>
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</summary>
<param name="path">The path to use</param>
<param name="duration">The duration of the tween</param>
<param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOTimeScale(DG.Tweening.Tween,System.Single,System.Single)"> <member name="M:DG.Tweening.ShortcutExtensions.DOTimeScale(DG.Tweening.Tween,System.Single,System.Single)">
<summary>Tweens a Tween's timeScale to the given value. <summary>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</summary> Also stores the Tween as the tween's target so it can be used for filtered operations</summary>
@ -2523,9 +2479,21 @@
<member name="F:DG.Tweening.Tween.onWaypointChange"> <member name="F:DG.Tweening.Tween.onWaypointChange">
<summary>Called when a path tween's current waypoint changes</summary> <summary>Called when a path tween's current waypoint changes</summary>
</member> </member>
<member name="P:DG.Tweening.Tween.isRelative">
<summary>Tweeners-only (ignored by Sequences), returns TRUE if the tween was set as relative</summary>
</member>
<member name="P:DG.Tweening.Tween.active">
<summary>FALSE when tween is (or should be) despawned - set only by TweenManager</summary>
</member>
<member name="P:DG.Tweening.Tween.fullPosition"> <member name="P:DG.Tweening.Tween.fullPosition">
<summary>Gets and sets the time position (loops included, delays excluded) of the tween</summary> <summary>Gets and sets the time position (loops included, delays excluded) of the tween</summary>
</member> </member>
<member name="P:DG.Tweening.Tween.playedOnce">
<summary>TRUE after the tween was set in a play state at least once, AFTER any delay is elapsed</summary>
</member>
<member name="P:DG.Tweening.Tween.position">
<summary>Time position within a single loop cycle</summary>
</member>
<member name="T:DG.Tweening.Tweener"> <member name="T:DG.Tweening.Tweener">
<summary> <summary>
Animates a single value Animates a single value

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 589b8271dd960624a8620bca5ed778db
timeCreated: 1431691486
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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:

View File

@ -1,85 +0,0 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>DOTween43</name>
</assembly>
<members>
<member name="T:DG.Tweening.ShortcutExtensions43">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOGradientColor(UnityEngine.Material,UnityEngine.Gradient,System.Single)">
<summary>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</summary>
<param name="gradient">The gradient to use</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOGradientColor(UnityEngine.Material,UnityEngine.Gradient,System.String,System.Single)">
<summary>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</summary>
<param name="gradient">The gradient to use</param>
<param name="property">The name of the material property to tween (like _Tint or _SpecColor)</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOColor(UnityEngine.SpriteRenderer,UnityEngine.Color,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOFade(UnityEngine.SpriteRenderer,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOGradientColor(UnityEngine.SpriteRenderer,UnityEngine.Gradient,System.Single)">
<summary>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</summary>
<param name="gradient">The gradient to use</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOMove(UnityEngine.Rigidbody2D,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOMoveX(UnityEngine.Rigidbody2D,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOMoveY(UnityEngine.Rigidbody2D,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DORotate(UnityEngine.Rigidbody2D,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOJump(UnityEngine.Rigidbody2D,UnityEngine.Vector2,System.Single,System.Int32,System.Single,System.Boolean)">
<summary>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.
<para>IMPORTANT: a rigidbody2D can't be animated in a jump arc using MovePosition, so the tween will directly set the position</para></summary>
<param name="endValue">The end value to reach</param>
<param name="jumpPower">Power of the jump (the max height of the jump is represented by this plus the final Y offset)</param>
<param name="numJumps">Total number of jumps</param>
<param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOBlendableColor(UnityEngine.SpriteRenderer,UnityEngine.Color,System.Single)">
<summary>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</summary>
<param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
</member>
</members>
</doc>

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 6e08c600d5d981242b5d3c1d825106d6
timeCreated: 1431691500
licenseType: Free
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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:

View File

@ -1,279 +0,0 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>DOTween46</name>
</assembly>
<members>
<member name="T:DG.Tweening.DOTweenUtils46">
<summary>
Various utils that require Unity 4.6 or later
</summary>
</member>
<member name="M:DG.Tweening.DOTweenUtils46.SwitchToRectTransform(UnityEngine.RectTransform,UnityEngine.RectTransform)">
<summary>
Converts the anchoredPosition of the first RectTransform to the second RectTransform,
taking into consideration offset, anchors and pivot, and returns the new anchoredPosition
</summary>
</member>
<member name="T:DG.Tweening.ShortcutExtensions46">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOFade(UnityEngine.CanvasGroup,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOColor(UnityEngine.UI.Graphic,UnityEngine.Color,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOFade(UnityEngine.UI.Graphic,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOColor(UnityEngine.UI.Image,UnityEngine.Color,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOFade(UnityEngine.UI.Image,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOFillAmount(UnityEngine.UI.Image,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach (0 to 1)</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOGradientColor(UnityEngine.UI.Image,UnityEngine.Gradient,System.Single)">
<summary>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</summary>
<param name="gradient">The gradient to use</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOFlexibleSize(UnityEngine.UI.LayoutElement,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOMinSize(UnityEngine.UI.LayoutElement,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOPreferredSize(UnityEngine.UI.LayoutElement,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOColor(UnityEngine.UI.Outline,UnityEngine.Color,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOFade(UnityEngine.UI.Outline,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOScale(UnityEngine.UI.Outline,UnityEngine.Vector2,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOAnchorPos(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOAnchorPosX(UnityEngine.RectTransform,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOAnchorPosY(UnityEngine.RectTransform,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOAnchorPos3D(UnityEngine.RectTransform,UnityEngine.Vector3,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOAnchorPos3DX(UnityEngine.RectTransform,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOAnchorPos3DY(UnityEngine.RectTransform,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOAnchorPos3DZ(UnityEngine.RectTransform,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOAnchorMax(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOAnchorMin(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOPivot(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOPivotX(UnityEngine.RectTransform,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOPivotY(UnityEngine.RectTransform,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOSizeDelta(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOPunchAnchorPos(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Int32,System.Single,System.Boolean)">
<summary>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</summary>
<param name="punch">The direction and strength of the punch (added to the RectTransform's current position)</param>
<param name="duration">The duration of the tween</param>
<param name="vibrato">Indicates how much will the punch vibrate</param>
<param name="elasticity">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</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOShakeAnchorPos(UnityEngine.RectTransform,System.Single,System.Single,System.Int32,System.Single,System.Boolean,System.Boolean)">
<summary>Shakes a RectTransform's anchoredPosition with the given values.
Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
<param name="duration">The duration of the tween</param>
<param name="strength">The shake strength</param>
<param name="vibrato">Indicates how much will the shake vibrate</param>
<param name="randomness">Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
Setting it to 0 will shake along a single direction.</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
<param name="fadeOut">If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOShakeAnchorPos(UnityEngine.RectTransform,System.Single,UnityEngine.Vector2,System.Int32,System.Single,System.Boolean,System.Boolean)">
<summary>Shakes a RectTransform's anchoredPosition with the given values.
Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
<param name="duration">The duration of the tween</param>
<param name="strength">The shake strength on each axis</param>
<param name="vibrato">Indicates how much will the shake vibrate</param>
<param name="randomness">Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
Setting it to 0 will shake along a single direction.</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
<param name="fadeOut">If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOJumpAnchorPos(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Int32,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param>
<param name="jumpPower">Power of the jump (the max height of the jump is represented by this plus the final Y offset)</param>
<param name="numJumps">Total number of jumps</param>
<param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DONormalizedPos(UnityEngine.UI.ScrollRect,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOHorizontalNormalizedPos(UnityEngine.UI.ScrollRect,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOVerticalNormalizedPos(UnityEngine.UI.ScrollRect,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOValue(UnityEngine.UI.Slider,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOColor(UnityEngine.UI.Text,UnityEngine.Color,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOFade(UnityEngine.UI.Text,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOText(UnityEngine.UI.Text,System.String,System.Single,System.Boolean,DG.Tweening.ScrambleMode,System.String)">
<summary>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</summary>
<param name="endValue">The end string to tween to</param><param name="duration">The duration of the tween</param>
<param name="richTextEnabled">If TRUE (default), rich text will be interpreted correctly while animated,
otherwise all tags will be considered as normal text</param>
<param name="scrambleMode">The type of scramble mode to use, if any</param>
<param name="scrambleChars">A string containing the characters to use for scrambling.
Use as many characters as possible (minimum 10) because DOTween uses a fast scramble mode which gives better results with more characters.
Leave it to NULL (default) to use default ones</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOBlendableColor(UnityEngine.UI.Graphic,UnityEngine.Color,System.Single)">
<summary>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</summary>
<param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOBlendableColor(UnityEngine.UI.Image,UnityEngine.Color,System.Single)">
<summary>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</summary>
<param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOBlendableColor(UnityEngine.UI.Text,UnityEngine.Color,System.Single)">
<summary>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</summary>
<param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
</member>
</members>
</doc>

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: d27835d6231b6aa48841c3f8b2214fa8
timeCreated: 1431691500
licenseType: Free
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 011d3116e0e87e3468e30ecd026d2dbc
timeCreated: 1431691486
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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:

View File

@ -1,163 +0,0 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>DOTween50</name>
</assembly>
<members>
<member name="T:DG.Tweening.ShortcutExtensions50">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOSetFloat(UnityEngine.Audio.AudioMixer,System.String,System.Single,System.Single)">
<summary>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.</summary>
<param name="floatName">Name given to the exposed float to set</param>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOComplete(UnityEngine.Audio.AudioMixer,System.Boolean)">
<summary>
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)
</summary>
<param name="withCallbacks">For Sequences only: if TRUE also internal Sequence callbacks will be fired,
otherwise they will be ignored</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOKill(UnityEngine.Audio.AudioMixer,System.Boolean)">
<summary>
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.
</summary>
<param name="complete">If TRUE completes the tween before killing it</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOFlip(UnityEngine.Audio.AudioMixer)">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOGoto(UnityEngine.Audio.AudioMixer,System.Single,System.Boolean)">
<summary>
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.
</summary>
<param name="to">Time position to reach
(if higher than the whole tween duration the tween will simply reach its end)</param>
<param name="andPlay">If TRUE will play the tween after reaching the given position, otherwise it will pause it</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOPause(UnityEngine.Audio.AudioMixer)">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOPlay(UnityEngine.Audio.AudioMixer)">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOPlayBackwards(UnityEngine.Audio.AudioMixer)">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOPlayForward(UnityEngine.Audio.AudioMixer)">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DORestart(UnityEngine.Audio.AudioMixer)">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DORewind(UnityEngine.Audio.AudioMixer)">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOSmoothRewind(UnityEngine.Audio.AudioMixer)">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOTogglePause(UnityEngine.Audio.AudioMixer)">
<summary>
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.
</summary>
</member>
<member name="T:DG.Tweening.TweenExtensions53">
<summary>
Methods that extend Tween objects and allow to control or get data from them.
These require at least Unity 5.3
</summary>
</member>
<member name="M:DG.Tweening.TweenExtensions53.WaitForCompletion(DG.Tweening.Tween,System.Boolean)">
<summary>
Returns a <see cref="T:UnityEngine.CustomYieldInstruction"/> that waits until the tween is killed or complete.
It can be used inside a coroutine as a yield.
<para>Example usage:</para><code>yield return myTween.WaitForCompletion(true);</code>
</summary>
</member>
<member name="M:DG.Tweening.TweenExtensions53.WaitForRewind(DG.Tweening.Tween,System.Boolean)">
<summary>
Returns a <see cref="T:UnityEngine.CustomYieldInstruction"/> that waits until the tween is killed or rewinded.
It can be used inside a coroutine as a yield.
<para>Example usage:</para><code>yield return myTween.WaitForRewind();</code>
</summary>
</member>
<member name="M:DG.Tweening.TweenExtensions53.WaitForKill(DG.Tweening.Tween,System.Boolean)">
<summary>
Returns a <see cref="T:UnityEngine.CustomYieldInstruction"/> that waits until the tween is killed.
It can be used inside a coroutine as a yield.
<para>Example usage:</para><code>yield return myTween.WaitForKill();</code>
</summary>
</member>
<member name="M:DG.Tweening.TweenExtensions53.WaitForElapsedLoops(DG.Tweening.Tween,System.Int32,System.Boolean)">
<summary>
Returns a <see cref="T:UnityEngine.CustomYieldInstruction"/> 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.
<para>Example usage:</para><code>yield return myTween.WaitForElapsedLoops(2);</code>
</summary>
<param name="elapsedLoops">Elapsed loops to wait for</param>
</member>
<member name="M:DG.Tweening.TweenExtensions53.WaitForPosition(DG.Tweening.Tween,System.Single,System.Boolean)">
<summary>
Returns a <see cref="T:UnityEngine.CustomYieldInstruction"/> 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.
<para>Example usage:</para><code>yield return myTween.WaitForPosition(2.5f);</code>
</summary>
<param name="position">Position (loops included, delays excluded) to wait for</param>
</member>
<member name="M:DG.Tweening.TweenExtensions53.WaitForStart(DG.Tweening.Tween,System.Boolean)">
<summary>
Returns a <see cref="T:UnityEngine.CustomYieldInstruction"/> 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.
<para>Example usage:</para><code>yield return myTween.WaitForStart();</code>
</summary>
</member>
</members>
</doc>

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 3a6814e095786e74faa2c054ea887651
timeCreated: 1431691500
licenseType: Free
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -4,37 +4,37 @@
<name>DOTweenEditor</name> <name>DOTweenEditor</name>
</assembly> </assembly>
<members> <members>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.SetEditorTexture(UnityEngine.Texture2D,UnityEngine.FilterMode,System.Int32)"> <member name="M:DG.DOTweenEditor.EditorUtils.SetEditorTexture(UnityEngine.Texture2D,UnityEngine.FilterMode,System.Int32)">
<summary> <summary>
Checks that the given editor texture use the correct import settings, Checks that the given editor texture use the correct import settings,
and applies them if they're incorrect. and applies them if they're incorrect.
</summary> </summary>
</member> </member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.DOTweenSetupRequired"> <member name="M:DG.DOTweenEditor.EditorUtils.DOTweenSetupRequired">
<summary> <summary>
Returns TRUE if addons setup is required. Returns TRUE if setup is required
</summary> </summary>
</member> </member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.AssetExists(System.String)"> <member name="M:DG.DOTweenEditor.EditorUtils.AssetExists(System.String)">
<summary> <summary>
Returns TRUE if the file/directory at the given path exists. Returns TRUE if the file/directory at the given path exists.
</summary> </summary>
<param name="adbPath">Path, relative to Unity's project folder</param> <param name="adbPath">Path, relative to Unity's project folder</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.ADBPathToFullPath(System.String)"> <member name="M:DG.DOTweenEditor.EditorUtils.ADBPathToFullPath(System.String)">
<summary> <summary>
Converts the given project-relative path to a full path, Converts the given project-relative path to a full path,
with backward (\) slashes). with backward (\) slashes).
</summary> </summary>
</member> </member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.FullPathToADBPath(System.String)"> <member name="M:DG.DOTweenEditor.EditorUtils.FullPathToADBPath(System.String)">
<summary> <summary>
Converts the given full path to a path usable with AssetDatabase methods 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). (relative to Unity's project folder, and with the correct Unity forward (/) slashes).
</summary> </summary>
</member> </member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.ConnectToSourceAsset``1(System.String,System.Boolean)"> <member name="M:DG.DOTweenEditor.EditorUtils.ConnectToSourceAsset``1(System.String,System.Boolean)">
<summary> <summary>
Connects to a <see cref="T:UnityEngine.ScriptableObject"/> asset. Connects to a <see cref="T:UnityEngine.ScriptableObject"/> asset.
If the asset already exists at the given path, loads it and returns it. If the asset already exists at the given path, loads it and returns it.
@ -45,21 +45,33 @@
<param name="adbFilePath">File path (relative to Unity's project folder)</param> <param name="adbFilePath">File path (relative to Unity's project folder)</param>
<param name="createIfMissing">If TRUE and the requested asset doesn't exist, forces its creation</param> <param name="createIfMissing">If TRUE and the requested asset doesn't exist, forces its creation</param>
</member> </member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.GetAssemblyFilePath(System.Reflection.Assembly)"> <member name="M:DG.DOTweenEditor.EditorUtils.GetAssemblyFilePath(System.Reflection.Assembly)">
<summary> <summary>
Full path for the given loaded assembly, assembly file included Full path for the given loaded assembly, assembly file included
</summary> </summary>
</member> </member>
<member name="T:DG.DOTweenEditor.DOTweenSetupMenuItem"> <member name="M:DG.DOTweenEditor.EditorUtils.AddGlobalDefine(System.String)">
<summary>
Adds the given global define if it's not already present
</summary>
</member>
<member name="M:DG.DOTweenEditor.EditorUtils.RemoveGlobalDefine(System.String)">
<summary>
Removes the given global define if it's present
</summary>
</member>
<member name="M:DG.DOTweenEditor.EditorUtils.HasGlobalDefine(System.String,System.Nullable{UnityEditor.BuildTargetGroup})">
<summary>
Returns TRUE if the given global define is present in all the <see cref="T:UnityEditor.BuildTargetGroup"/>
or only in the given <see cref="T:UnityEditor.BuildTargetGroup"/>, depending on passed parameters.<para/>
</summary>
<param name="id"></param>
<param name="buildTargetGroup"><see cref="T:UnityEditor.BuildTargetGroup"/>to use. Leave NULL to check in all of them.</param>
</member>
<member name="T:DG.DOTweenEditor.DOTweenDefines">
<summary> <summary>
Not used as menu item anymore, but as a utiity function Not used as menu item anymore, but as a utiity function
</summary> </summary>
</member> </member>
<member name="M:DG.DOTweenEditor.DOTweenSetupMenuItem.Setup(System.Boolean)">
<summary>
Setups DOTween
</summary>
<param name="partiallySilent">If TRUE, no warning window appears in case there is no need for setup</param>
</member>
</members> </members>
</doc> </doc>

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 22a87305a04c84e40964cdfae301554e
timeCreated: 1449422216
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,6 +1,7 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 9bb63fd0cf03cdc4d9e59294bc161dfc guid: c5103b30f7e1e714c82938edde7b7a51
timeCreated: 1452683141 folderAsset: yes
timeCreated: 1531821975
licenseType: Pro licenseType: Pro
DefaultImporter: DefaultImporter:
userData: userData:

View File

@ -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
/// <summary>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</summary>
/// <param name="endValue">The end value to reach (0 to 1)</param><param name="duration">The duration of the tween</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
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)
/// <summary>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.</summary>
/// <param name="floatName">Name given to the exposed float to set</param>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
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
/// <summary>
/// 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)
/// </summary>
/// <param name="withCallbacks">For Sequences only: if TRUE also internal Sequence callbacks will be fired,
/// otherwise they will be ignored</param>
public static int DOComplete(this AudioMixer target, bool withCallbacks = false)
{
return DOTween.Complete(target, withCallbacks);
}
/// <summary>
/// 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.
/// </summary>
/// <param name="complete">If TRUE completes the tween before killing it</param>
public static int DOKill(this AudioMixer target, bool complete = false)
{
return DOTween.Kill(target, complete);
}
/// <summary>
/// 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.
/// </summary>
public static int DOFlip(this AudioMixer target)
{
return DOTween.Flip(target);
}
/// <summary>
/// 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.
/// </summary>
/// <param name="to">Time position to reach
/// (if higher than the whole tween duration the tween will simply reach its end)</param>
/// <param name="andPlay">If TRUE will play the tween after reaching the given position, otherwise it will pause it</param>
public static int DOGoto(this AudioMixer target, float to, bool andPlay = false)
{
return DOTween.Goto(target, to, andPlay);
}
/// <summary>
/// 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.
/// </summary>
public static int DOPause(this AudioMixer target)
{
return DOTween.Pause(target);
}
/// <summary>
/// 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.
/// </summary>
public static int DOPlay(this AudioMixer target)
{
return DOTween.Play(target);
}
/// <summary>
/// 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.
/// </summary>
public static int DOPlayBackwards(this AudioMixer target)
{
return DOTween.PlayBackwards(target);
}
/// <summary>
/// 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.
/// </summary>
public static int DOPlayForward(this AudioMixer target)
{
return DOTween.PlayForward(target);
}
/// <summary>
/// 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.
/// </summary>
public static int DORestart(this AudioMixer target)
{
return DOTween.Restart(target);
}
/// <summary>
/// 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.
/// </summary>
public static int DORewind(this AudioMixer target)
{
return DOTween.Rewind(target);
}
/// <summary>
/// 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.
/// </summary>
public static int DOSmoothRewind(this AudioMixer target)
{
return DOTween.SmoothRewind(target);
}
/// <summary>
/// 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.
/// </summary>
public static int DOTogglePause(this AudioMixer target)
{
return DOTween.TogglePause(target);
}
#endregion
#endregion
#endif
#endregion
}
}
#endif

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 0223eae4c5094ed4dbfa04756ed4dd63
timeCreated: 1531903663
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="mode">Rotation mode</param>
public static Tweener DORotate(this Rigidbody target, Vector3 endValue, float duration, RotateMode mode = RotateMode.Fast)
{
TweenerCore<Quaternion, Vector3, QuaternionOptions> t = DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration);
t.SetTarget(target);
t.plugOptions.rotateMode = mode;
return t;
}
/// <summary>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</summary>
/// <param name="towards">The position to look at</param><param name="duration">The duration of the tween</param>
/// <param name="axisConstraint">Eventual axis constraint for the rotation</param>
/// <param name="up">The vector that defines in which direction up is (default: Vector3.up)</param>
public static Tweener DOLookAt(this Rigidbody target, Vector3 towards, float duration, AxisConstraint axisConstraint = AxisConstraint.None, Vector3? up = null)
{
TweenerCore<Quaternion, Vector3, QuaternionOptions> 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
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param>
/// <param name="jumpPower">Power of the jump (the max height of the jump is represented by this plus the final Y offset)</param>
/// <param name="numJumps">Total number of jumps</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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;
}
/// <summary>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.
/// <para>NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.</para>
/// <para>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.</para></summary>
/// <param name="path">The waypoints to go through</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="pathType">The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)</param>
/// <param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
/// <param name="resolution">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</param>
/// <param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
public static TweenerCore<Vector3, Path, PathOptions> 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<Vector3, Path, PathOptions> 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;
}
/// <summary>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
/// <para>NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.</para>
/// <para>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.</para></summary>
/// <param name="path">The waypoint to go through</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="pathType">The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)</param>
/// <param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
/// <param name="resolution">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</param>
/// <param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
public static TweenerCore<Vector3, Path, PathOptions> 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<Vector3, Path, PathOptions> 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<Vector3, Path, PathOptions> DOPath(
this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D
)
{
TweenerCore<Vector3, Path, PathOptions> 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<Vector3, Path, PathOptions> DOLocalPath(
this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D
)
{
Transform trans = target.transform;
TweenerCore<Vector3, Path, PathOptions> 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

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 3b013f26d887cf94e839b467ef843e07
timeCreated: 1531903664
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static Tweener DORotate(this Rigidbody2D target, float endValue, float duration)
{
return DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration)
.SetTarget(target);
}
#region Special
/// <summary>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.
/// <para>IMPORTANT: a rigidbody2D can't be animated in a jump arc using MovePosition, so the tween will directly set the position</para></summary>
/// <param name="endValue">The end value to reach</param>
/// <param name="jumpPower">Power of the jump (the max height of the jump is represented by this plus the final Y offset)</param>
/// <param name="numJumps">Total number of jumps</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: d023370de51f832488edc0b181cd9e20
timeCreated: 1531903664
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static Tweener DOColor(this SpriteRenderer target, Color endValue, float duration)
{
return DOTween.To(() => target.color, x => target.color = x, endValue, duration).SetTarget(target);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static Tweener DOFade(this SpriteRenderer target, float endValue, float duration)
{
return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration)
.SetTarget(target);
}
/// <summary>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</summary>
/// <param name="gradient">The gradient to use</param><param name="duration">The duration of the tween</param>
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
/// <summary>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</summary>
/// <param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
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

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 27bcd8d6727d42c499cdcb2e021873a2
timeCreated: 1531903663
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
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
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static Tweener DOColor(this Graphic target, Color endValue, float duration)
{
return DOTween.To(() => target.color, x => target.color = x, endValue, duration).SetTarget(target);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
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
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static Tweener DOColor(this Image target, Color endValue, float duration)
{
return DOTween.To(() => target.color, x => target.color = x, endValue, duration).SetTarget(target);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static Tweener DOFade(this Image target, float endValue, float duration)
{
return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration)
.SetTarget(target);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach (0 to 1)</param><param name="duration">The duration of the tween</param>
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);
}
/// <summary>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</summary>
/// <param name="gradient">The gradient to use</param><param name="duration">The duration of the tween</param>
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
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static Tweener DOColor(this Outline target, Color endValue, float duration)
{
return DOTween.To(() => target.effectColor, x => target.effectColor = x, endValue, duration).SetTarget(target);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static Tweener DOFade(this Outline target, float endValue, float duration)
{
return DOTween.ToAlpha(() => target.effectColor, x => target.effectColor = x, endValue, duration)
.SetTarget(target);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
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
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static Tweener DOPivot(this RectTransform target, Vector2 endValue, float duration)
{
return DOTween.To(() => target.pivot, x => target.pivot = x, endValue, duration)
.SetTarget(target);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="punch">The direction and strength of the punch (added to the RectTransform's current position)</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="vibrato">Indicates how much will the punch vibrate</param>
/// <param name="elasticity">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</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>Shakes a RectTransform's anchoredPosition with the given values.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="duration">The duration of the tween</param>
/// <param name="strength">The shake strength</param>
/// <param name="vibrato">Indicates how much will the shake vibrate</param>
/// <param name="randomness">Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
/// Setting it to 0 will shake along a single direction.</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
/// <param name="fadeOut">If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not</param>
public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, 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);
}
/// <summary>Shakes a RectTransform's anchoredPosition with the given values.
/// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
/// <param name="duration">The duration of the tween</param>
/// <param name="strength">The shake strength on each axis</param>
/// <param name="vibrato">Indicates how much will the shake vibrate</param>
/// <param name="randomness">Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
/// Setting it to 0 will shake along a single direction.</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
/// <param name="fadeOut">If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not</param>
public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, Vector2 strength, int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true)
{
return DOTween.Shake(() => target.anchoredPosition, x => target.anchoredPosition = x, duration, strength, vibrato, randomness, fadeOut)
.SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping);
}
#region Special
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param>
/// <param name="jumpPower">Power of the jump (the max height of the jump is represented by this plus the final Y offset)</param>
/// <param name="numJumps">Total number of jumps</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static Tweener DOColor(this Text target, Color endValue, float duration)
{
return DOTween.To(() => target.color, x => target.color = x, endValue, duration).SetTarget(target);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static Tweener DOFade(this Text target, float endValue, float duration)
{
return DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration)
.SetTarget(target);
}
/// <summary>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</summary>
/// <param name="endValue">The end string to tween to</param><param name="duration">The duration of the tween</param>
/// <param name="richTextEnabled">If TRUE (default), rich text will be interpreted correctly while animated,
/// otherwise all tags will be considered as normal text</param>
/// <param name="scrambleMode">The type of scramble mode to use, if any</param>
/// <param name="scrambleChars">A string containing the characters to use for scrambling.
/// Use as many characters as possible (minimum 10) because DOTween uses a fast scramble mode which gives better results with more characters.
/// Leave it to NULL (default) to use default ones</param>
public static Tweener DOText(this 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
/// <summary>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</summary>
/// <param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
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
/// <summary>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</summary>
/// <param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
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
/// <summary>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</summary>
/// <param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
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
{
/// <summary>
/// Converts the anchoredPosition of the first RectTransform to the second RectTransform,
/// taking into consideration offset, anchors and pivot, and returns the new anchoredPosition
/// </summary>
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

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: dd744f5b62ad0fb4391fa4499a84a8c0
timeCreated: 1531903664
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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
{
/// <summary>
/// Shortcuts/functions that are not strictly related to specific Modules
/// but are available only on some Unity versions
/// </summary>
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
/// <summary>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</summary>
/// <param name="gradient">The gradient to use</param><param name="duration">The duration of the tween</param>
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;
}
/// <summary>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</summary>
/// <param name="gradient">The gradient to use</param>
/// <param name="property">The name of the material property to tween (like _Tint or _SpecColor)</param>
/// <param name="duration">The duration of the tween</param>
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)
/// <summary>
/// Returns a <see cref="CustomYieldInstruction"/> that waits until the tween is killed or complete.
/// It can be used inside a coroutine as a yield.
/// <para>Example usage:</para><code>yield return myTween.WaitForCompletion(true);</code>
/// </summary>
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);
}
/// <summary>
/// Returns a <see cref="CustomYieldInstruction"/> that waits until the tween is killed or rewinded.
/// It can be used inside a coroutine as a yield.
/// <para>Example usage:</para><code>yield return myTween.WaitForRewind();</code>
/// </summary>
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);
}
/// <summary>
/// Returns a <see cref="CustomYieldInstruction"/> that waits until the tween is killed.
/// It can be used inside a coroutine as a yield.
/// <para>Example usage:</para><code>yield return myTween.WaitForKill();</code>
/// </summary>
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);
}
/// <summary>
/// Returns a <see cref="CustomYieldInstruction"/> 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.
/// <para>Example usage:</para><code>yield return myTween.WaitForElapsedLoops(2);</code>
/// </summary>
/// <param name="elapsedLoops">Elapsed loops to wait for</param>
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);
}
/// <summary>
/// Returns a <see cref="CustomYieldInstruction"/> 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.
/// <para>Example usage:</para><code>yield return myTween.WaitForPosition(2.5f);</code>
/// </summary>
/// <param name="position">Position (loops included, delays excluded) to wait for</param>
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);
}
/// <summary>
/// Returns a <see cref="CustomYieldInstruction"/> 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.
/// <para>Example usage:</para><code>yield return myTween.WaitForStart();</code>
/// </summary>
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
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 39df9327575994a4fa959ed9a97a1e5e
timeCreated: 1531903664
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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
{
/// <summary>
/// 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
/// </summary>
public static class DOTweenModuleUtils
{
static bool _initialized;
/// <summary>
/// Called via Reflection by DOTweenComponent on Awake
/// </summary>
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<Rigidbody2D>() != 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<Rigidbody>() != null;
#else
return false;
#endif
}
// Called via Reflection by DOTweenPath
public static TweenerCore<Vector3, Path, PathOptions> CreateDOTweenPathTween(
MonoBehaviour target, bool tweenRigidbody, bool isLocal, Path path, float duration, PathMode pathMode
){
TweenerCore<Vector3, Path, PathOptions> t;
#if DOTPHYSICS
Rigidbody rBody = tweenRigidbody ? target.GetComponent<Rigidbody>() : 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
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 3fcddc0756073fd4aa84610b570ca6f9
timeCreated: 1531903664
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +1,17 @@
DOTween and DOTween Pro are copyright (c) 2014 Daniele Giardini - Demigiant 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 ////////////////////////////////////////////// // 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. - 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. - 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 website (documentation, examples, etc): http://dotween.demigiant.com
DOTween license: http://dotween.demigiant.com/license.php DOTween license: http://dotween.demigiant.com/license.php
DOTween repository (Google Code): https://code.google.com/p/dotween/ DOTween repository (Google Code): https://code.google.com/p/dotween/
Demigiant website (documentation, examples, etc): http://www.demigiant.com
// NOTES ////////////////////////////////////////////////////// // 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 - 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

View File

@ -1,7 +1,6 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 773153d471589be45acb355405a2bcf5 guid: 1fa36039328c18e48808faaf6a351f48
timeCreated: 1431691486 folderAsset: yes
licenseType: Free
DefaultImporter: DefaultImporter:
userData: userData:
assetBundleName: assetBundleName:

View File

@ -2,7 +2,7 @@
namespace TMPro namespace TMPro
{ {
public class TextMeshPro : MonoBehaviour public class TMP_Text : MonoBehaviour
{ {
public Color color, outlineColor, faceColor; public Color color, outlineColor, faceColor;
public Material fontMaterial, fontSharedMaterial; public Material fontMaterial, fontSharedMaterial;
@ -11,12 +11,13 @@ namespace TMPro
public string text; public string text;
} }
public class TextMeshProUGUI : MonoBehaviour public class TextMeshPro : TMP_Text
{ {
public Color color, outlineColor, faceColor;
public Material fontMaterial, fontSharedMaterial; }
public float fontSize;
public int maxVisibleCharacters; public class TextMeshProUGUI : TMP_Text
public string text; {
} }
} }

View File

@ -1,7 +1,6 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using DG.Tweening; using DG.Tweening;
using DG.Tweening.CustomYieldInstructions;
using UnityEngine; using UnityEngine;
public class CustomYieldInstructions : BrainBase public class CustomYieldInstructions : BrainBase

View File

@ -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); Vector2 bPivotDerivedOffset = new Vector2(b.rect.width * 0.5f + b.rect.xMin, b.rect.height * 0.5f + b.rect.yMin);
Debug.Log(bPivotDerivedOffset); Debug.Log(bPivotDerivedOffset);
b.anchoredPosition = b.anchoredPosition + localPoint - 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) string ArrayToString(IList list)

View File

@ -11,25 +11,17 @@ using UnityEngine.UI;
public class TempTests : BrainBase public class TempTests : BrainBase
{ {
public Image target; public Transform target0;
public Transform target1;
IEnumerator Start() IEnumerator Start()
{ {
Sequence _passenger_arrow_out = DOTween.Sequence(); Tween t0 = target0.DOBlendableLocalMoveBy(new Vector3(1, 2, 1), 2f);
_passenger_arrow_out.Insert(0, target.GetComponent<RectTransform>().DOAnchorPos(new Vector2(300f, 26f), 1f)); Tween t1 = target1.DOBlendableLocalMoveBy(new Vector3(1, -2, 1), 2f);
_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<RectTransform>().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();
yield return new WaitForSeconds(1); yield return new WaitForSeconds(1);
_passenger_arrow_out.Rewind(); t0.Kill();
_passenger_arrow_out.PlayForward(); t1.Goto(1.5f);
} }
} }

View File

@ -17,10 +17,20 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DOTween46", "DOTween46\DOTw
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DOTween50", "DOTween50\DOTween50.csproj", "{930C3B07-B00A-44B8-A8E5-452A8FD125C7}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DOTween50", "DOTween50\DOTween50.csproj", "{930C3B07-B00A-44B8-A8E5-452A8FD125C7}"
EndProject 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 Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
CompatibilityMode|Any CPU = CompatibilityMode|Any CPU CompatibilityMode|Any CPU = CompatibilityMode|Any CPU
Debug|Any CPU = Debug|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_NoRigidbody|Any CPU = Release_NoRigidbody|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
@ -29,6 +39,8 @@ Global
{DE17C145-3E8D-45D6-BBB6-D06BD7D80A55}.CompatibilityMode|Any CPU.Build.0 = CompatibilityMode|Any CPU {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.ActiveCfg = Debug|Any CPU
{DE17C145-3E8D-45D6-BBB6-D06BD7D80A55}.Debug|Any CPU.Build.0 = 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.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_NoRigidbody|Any CPU.Build.0 = Release_IncludeRigidbody|Any CPU
{DE17C145-3E8D-45D6-BBB6-D06BD7D80A55}.Release|Any CPU.ActiveCfg = Release|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}.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.ActiveCfg = Debug|Any CPU
{421ACC19-8922-4E98-8921-B52240CE172A}.Debug|Any CPU.Build.0 = 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.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_NoRigidbody|Any CPU.Build.0 = Release_IncludeRigidbody|Any CPU
{421ACC19-8922-4E98-8921-B52240CE172A}.Release|Any CPU.ActiveCfg = Release|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}.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.ActiveCfg = Debug|Any CPU
{20D2E542-D14F-4678-9C38-F3C0ECF6A2F6}.Debug|Any CPU.Build.0 = 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.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_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.ActiveCfg = Release|Any CPU
{20D2E542-D14F-4678-9C38-F3C0ECF6A2F6}.Release|Any CPU.Build.0 = 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.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.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.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.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.ActiveCfg = CompatibilityMode|Any CPU
{279545AE-D268-42F0-A4C6-AA5BA15FB9BE}.CompatibilityMode|Any CPU.Build.0 = 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.ActiveCfg = Debug|Any CPU
{279545AE-D268-42F0-A4C6-AA5BA15FB9BE}.Debug|Any CPU.Build.0 = 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.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_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.ActiveCfg = Release|Any CPU
{279545AE-D268-42F0-A4C6-AA5BA15FB9BE}.Release|Any CPU.Build.0 = 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.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.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.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.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.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.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.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.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 EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection 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 EndGlobal

View File

@ -1,2 +0,0 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CY/@EntryIndexedValue">CY</s:String></wpf:ResourceDictionary>

View File

@ -4,7 +4,9 @@
// License Copyright (c) Daniele Giardini. // License Copyright (c) Daniele Giardini.
// This work is subject to the terms at http://dotween.demigiant.com/license.php // This work is subject to the terms at http://dotween.demigiant.com/license.php
using System;
using System.Collections; using System.Collections;
using System.Reflection;
using UnityEngine; using UnityEngine;
#pragma warning disable 1591 #pragma warning disable 1591
@ -31,6 +33,15 @@ namespace DG.Tweening.Core
{ {
inspectorUpdater = 0; inspectorUpdater = 0;
_unscaledTime = Time.realtimeSinceStartup; _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() void Start()

View File

@ -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
{
/// <summary>
/// Used to dispatch commands that need to be captured externally, usually by Modules
/// </summary>
public static class DOTweenExternalCommand
{
public static event Action<PathOptions,Tween,Quaternion,Transform> SetOrientationOnPath;
internal static void Dispatch_SetOrientationOnPath(PathOptions options, Tween t, Quaternion newRot, Transform trans)
{ if (SetOrientationOnPath != null) SetOrientationOnPath(options, t, newRot, trans); }
}
}

View File

@ -4,9 +4,10 @@
// License Copyright (c) Daniele Giardini. // License Copyright (c) Daniele Giardini.
// This work is subject to the terms at http://dotween.demigiant.com/license.php // This work is subject to the terms at http://dotween.demigiant.com/license.php
#pragma warning disable 1591
namespace DG.Tweening.Core.Enums namespace DG.Tweening.Core.Enums
{ {
internal enum SpecialStartupMode public enum SpecialStartupMode
{ {
None, None,
SetLookAt, SetLookAt,

View File

@ -14,27 +14,33 @@ namespace DG.Tweening.Core
/// </summary> /// </summary>
public static class Extensions public static class Extensions
{ {
// Used internally by DO shortcuts to set special startup mode /// <summary>
internal static T SetSpecialStartupMode<T>(this T t, SpecialStartupMode mode) where T : Tween /// INTERNAL: used by DO shortcuts and Modules to set special startup mode
/// </summary>
public static T SetSpecialStartupMode<T>(this T t, SpecialStartupMode mode) where T : Tween
{ {
t.specialStartupMode = mode; t.specialStartupMode = mode;
return t; return t;
} }
// Prevents a tween to use a From setup even if passed /// <summary>
internal static TweenerCore<T1, T2, TPlugOptions> NoFrom<T1, T2, TPlugOptions>(this TweenerCore<T1, T2, TPlugOptions> t) /// INTERNAL: used by DO shortcuts and Modules to set the tween as blendable
where TPlugOptions : struct, IPlugOptions /// </summary>
{ public static TweenerCore<T1, T2, TPlugOptions> Blendable<T1, T2, TPlugOptions>(this TweenerCore<T1, T2, TPlugOptions> t)
t.isFromAllowed = false;
return t;
}
// Sets the tween as blendable
internal static TweenerCore<T1, T2, TPlugOptions> Blendable<T1, T2, TPlugOptions>(this TweenerCore<T1, T2, TPlugOptions> t)
where TPlugOptions : struct, IPlugOptions where TPlugOptions : struct, IPlugOptions
{ {
t.isBlendable = true; t.isBlendable = true;
return t; return t;
} }
/// <summary>
/// INTERNAL: used by DO shortcuts and Modules to prevent a tween from using a From setup even if passed
/// </summary>
public static TweenerCore<T1, T2, TPlugOptions> NoFrom<T1, T2, TPlugOptions>(this TweenerCore<T1, T2, TPlugOptions> t)
where TPlugOptions : struct, IPlugOptions
{
t.isFromAllowed = false;
return t;
}
} }
} }

View File

@ -4,12 +4,19 @@
// License Copyright (c) Daniele Giardini. // License Copyright (c) Daniele Giardini.
// This work is subject to the terms at http://dotween.demigiant.com/license.php // This work is subject to the terms at http://dotween.demigiant.com/license.php
using System;
using System.Reflection;
using UnityEngine; using UnityEngine;
namespace DG.Tweening.Core namespace DG.Tweening.Core
{ {
internal static class Utils 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"
};
/// <summary> /// <summary>
/// Returns a Vector3 with z = 0 /// Returns a Vector3 with z = 0
/// </summary> /// </summary>
@ -44,6 +51,27 @@ namespace DG.Tweening.Core
&& Mathf.Approximately(a.z, b.z); && Mathf.Approximately(a.z, b.z);
} }
/// <summary>
/// Looks for the type withing all possible project assembly names
/// </summary>
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 ████████████████████████████████████████████████████████████████████████████████████████████████ // ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████
// █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████

View File

@ -32,7 +32,7 @@ namespace DG.Tweening
public class DOTween public class DOTween
{ {
/// <summary>DOTween's version</summary> /// <summary>DOTween's version</summary>
public static readonly string Version = "1.1.755"; public static readonly string Version = "1.2.004"; // Last version before modules: 1.1.755
/////////////////////////////////////////////// ///////////////////////////////////////////////
// Options //////////////////////////////////// // Options ////////////////////////////////////

View File

@ -64,7 +64,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="UnityEngine"> <Reference Include="UnityEngine">
<HintPath>C:\Program Files (x86)\Unity 3\Editor\Data\Managed\UnityEngine.dll</HintPath> <HintPath>C:\Program Files (x86)\Unity 46\Editor\Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
@ -87,6 +87,7 @@
<Compile Include="Core\Enums\UpdateNotice.cs" /> <Compile Include="Core\Enums\UpdateNotice.cs" />
<Compile Include="Core\Enums\UpdateMode.cs" /> <Compile Include="Core\Enums\UpdateMode.cs" />
<Compile Include="Core\Extensions.cs" /> <Compile Include="Core\Extensions.cs" />
<Compile Include="Core\DOTweenExternalCommand.cs" />
<Compile Include="Core\SequenceCallback.cs" /> <Compile Include="Core\SequenceCallback.cs" />
<Compile Include="Core\Surrogates\ColorWrapper.cs" /> <Compile Include="Core\Surrogates\ColorWrapper.cs" />
<Compile Include="Core\Surrogates\QuaternionWrapper.cs" /> <Compile Include="Core\Surrogates\QuaternionWrapper.cs" />
@ -166,47 +167,7 @@
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>set BinDir=bin.Global\DOTween <PostBuildEvent>call $(SolutionDir)PostBuild_DOTween.bat $(SolutionDir) $(TargetDir) $(TargetFileName) $(TargetName) DOTween bin</PostBuildEvent>
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</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -11,9 +11,9 @@ namespace DG.Tweening.Plugins.Options
{ {
public struct QuaternionOptions : IPlugOptions public struct QuaternionOptions : IPlugOptions
{ {
internal RotateMode rotateMode; public RotateMode rotateMode; // Accessed by shortcuts and Modules
internal AxisConstraint axisConstraint; // Used by SpecialStartupMode SetLookAt public AxisConstraint axisConstraint; // Used by SpecialStartupMode SetLookAt, accessed by shortcuts and Modules
internal Vector3 up; // Used by SpecialStartupMode SetLookAt public Vector3 up; // Used by SpecialStartupMode SetLookAt, accessed by shortcuts and Modules
public void Reset() public void Reset()
{ {

View File

@ -217,12 +217,13 @@ namespace DG.Tweening.Plugins
} }
if (options.hasCustomForwardDirection) newRot *= options.forward; if (options.hasCustomForwardDirection) newRot *= options.forward;
#if RIGIDBODY DOTweenExternalCommand.Dispatch_SetOrientationOnPath(options, t, newRot, trans);
if (options.isRigidbody) ((Rigidbody)t.target).rotation = newRot; //#if RIGIDBODY
else trans.rotation = newRot; // if (options.isRigidbody) ((Rigidbody)t.target).rotation = newRot;
#else // else trans.rotation = newRot;
trans.rotation = newRot; //#else
#endif // trans.rotation = newRot;
//#endif
} }
} }
} }

View File

@ -31,28 +31,6 @@ namespace DG.Tweening
// =================================================================================== // ===================================================================================
// CREATION SHORTCUTS ---------------------------------------------------------------- // CREATION SHORTCUTS ----------------------------------------------------------------
#region Audio Shortcuts
/// <summary>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</summary>
/// <param name="endValue">The end value to reach (0 to 1)</param><param name="duration">The duration of the tween</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
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
#region Camera Shortcuts #region Camera Shortcuts
/// <summary>Tweens a Camera's <code>aspect</code> to the given value. /// <summary>Tweens a Camera's <code>aspect</code> to the given value.
@ -355,233 +333,6 @@ namespace DG.Tweening
#endregion #endregion
#if RIGIDBODY
#region Rigidbody Shortcuts
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static Tweener DOMove(this Rigidbody target, Vector3 endValue, float duration, bool snapping = false)
{
#if COMPATIBLE
return DOTween.To(() => target.position, x=> target.MovePosition(x.value), endValue, duration)
#else
return DOTween.To(() => target.position, target.MovePosition, endValue, duration)
#endif
.SetOptions(snapping).SetTarget(target);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static Tweener DOMoveX(this Rigidbody target, float endValue, float duration, bool snapping = false)
{
#if COMPATIBLE
return DOTween.To(() => target.position, x => target.MovePosition(x.value), new Vector3(endValue, 0, 0), duration)
#else
return DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue, 0, 0), duration)
#endif
.SetOptions(AxisConstraint.X, snapping).SetTarget(target);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static Tweener DOMoveY(this Rigidbody target, float endValue, float duration, bool snapping = false)
{
#if COMPATIBLE
return DOTween.To(() => target.position, x => target.MovePosition(x.value), new Vector3(0, endValue, 0), duration)
#else
return DOTween.To(() => target.position, target.MovePosition, new Vector3(0, endValue, 0), duration)
#endif
.SetOptions(AxisConstraint.Y, snapping).SetTarget(target);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
public static Tweener DOMoveZ(this Rigidbody target, float endValue, float duration, bool snapping = false)
{
#if COMPATIBLE
return DOTween.To(() => target.position, x => target.MovePosition(x.value), new Vector3(0, 0, endValue), duration)
#else
return DOTween.To(() => target.position, target.MovePosition, new Vector3(0, 0, endValue), duration)
#endif
.SetOptions(AxisConstraint.Z, snapping).SetTarget(target);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="mode">Rotation mode</param>
public static Tweener DORotate(this Rigidbody target, Vector3 endValue, float duration, RotateMode mode = RotateMode.Fast)
{
#if COMPATIBLE
TweenerCore<DOQuaternion, DOVector3, QuaternionOptions> t = DOTween.To(() => target.rotation, x => target.MoveRotation(x), endValue, duration);
#else
TweenerCore<Quaternion, Vector3, QuaternionOptions> t = DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration);
#endif
t.SetTarget(target);
t.plugOptions.rotateMode = mode;
return t;
}
/// <summary>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</summary>
/// <param name="towards">The position to look at</param><param name="duration">The duration of the tween</param>
/// <param name="axisConstraint">Eventual axis constraint for the rotation</param>
/// <param name="up">The vector that defines in which direction up is (default: Vector3.up)</param>
public static Tweener DOLookAt(this Rigidbody target, Vector3 towards, float duration, AxisConstraint axisConstraint = AxisConstraint.None, Vector3? up = null)
{
#if COMPATIBLE
TweenerCore<DOQuaternion, DOVector3, QuaternionOptions> t = DOTween.To(() => target.rotation, x => target.MoveRotation(x), towards, duration)
#else
TweenerCore<Quaternion, Vector3, QuaternionOptions> t = DOTween.To(() => target.rotation, target.MoveRotation, towards, duration)
#endif
.SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetLookAt);
t.plugOptions.axisConstraint = axisConstraint;
t.plugOptions.up = (up == null) ? Vector3.up : (Vector3)up;
return t;
}
#region Special
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param>
/// <param name="jumpPower">Power of the jump (the max height of the jump is represented by this plus the final Y offset)</param>
/// <param name="numJumps">Total number of jumps</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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();
#if COMPATIBLE
Tween yTween = DOTween.To(() => target.position, x => target.MovePosition(x.value), 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, x => target.MovePosition(x.value), new Vector3(endValue.x, 0, 0), duration)
#else
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)
#endif
.SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear)
#if COMPATIBLE
).Join(DOTween.To(() => target.position, x => target.MovePosition(x.value), new Vector3(0, 0, endValue.z), duration)
#else
).Join(DOTween.To(() => target.position, target.MovePosition, new Vector3(0, 0, endValue.z), duration)
#endif
.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;
}
/// <summary>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.
/// <para>NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.</para>
/// <para>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.</para></summary>
/// <param name="path">The waypoints to go through</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="pathType">The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)</param>
/// <param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
/// <param name="resolution">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</param>
/// <param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
public static TweenerCore<Vector3, Path, PathOptions> 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<Vector3, Path, PathOptions> 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;
}
/// <summary>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
/// <para>NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.</para>
/// <para>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.</para></summary>
/// <param name="path">The waypoint to go through</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="pathType">The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)</param>
/// <param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
/// <param name="resolution">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</param>
/// <param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
public static TweenerCore<Vector3, Path, PathOptions> 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<Vector3, Path, PathOptions> 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<Vector3, Path, PathOptions> DOPath(
this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D
)
{
TweenerCore<Vector3, Path, PathOptions> 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<Vector3, Path, PathOptions> DOLocalPath(
this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D
)
{
Transform trans = target.transform;
TweenerCore<Vector3, Path, PathOptions> 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
#endif
#region TrailRenderer Shortcuts #region TrailRenderer Shortcuts
/// <summary>Tweens a TrailRenderer's startWidth/endWidth to the given value. /// <summary>Tweens a TrailRenderer's startWidth/endWidth to the given value.
@ -1102,7 +853,13 @@ namespace DG.Tweening
return t; return t;
} }
// Used by path editor when creating the actual tween, so it can pass a pre-compiled path // Used by path editor when creating the actual tween, so it can pass a pre-compiled path
internal static TweenerCore<Vector3, Path, PathOptions> DOPath( /// <summary>IMPORTANT: Unless you really know what you're doing, you should use the overload that accepts a Vector3 array instead.<para/>
/// 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</summary>
/// <param name="path">The path to use</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
public static TweenerCore<Vector3, Path, PathOptions> DOPath(
this Transform target, Path path, float duration, PathMode pathMode = PathMode.Full3D this Transform target, Path path, float duration, PathMode pathMode = PathMode.Full3D
) )
{ {
@ -1112,7 +869,14 @@ namespace DG.Tweening
t.plugOptions.mode = pathMode; t.plugOptions.mode = pathMode;
return t; return t;
} }
internal static TweenerCore<Vector3, Path, PathOptions> DOLocalPath( // Used by path editor when creating the actual tween, so it can pass a pre-compiled path
/// <summary>IMPORTANT: Unless you really know what you're doing, you should use the overload that accepts a Vector3 array instead.<para/>
/// 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</summary>
/// <param name="path">The path to use</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
public static TweenerCore<Vector3, Path, PathOptions> DOLocalPath(
this Transform target, Path path, float duration, PathMode pathMode = PathMode.Full3D this Transform target, Path path, float duration, PathMode pathMode = PathMode.Full3D
) )
{ {

View File

@ -69,7 +69,8 @@ namespace DG.Tweening
internal LoopType loopType; internal LoopType loopType;
// Tweeners-only (shared by Sequences only for compatibility reasons, otherwise not used) // Tweeners-only (shared by Sequences only for compatibility reasons, otherwise not used)
internal float delay; internal float delay;
internal bool isRelative; /// <summary>Tweeners-only (ignored by Sequences), returns TRUE if the tween was set as relative</summary>
public bool isRelative { get; internal set; } // Required by Modules
internal Ease easeType; internal Ease easeType;
internal EaseFunction customEase; // Used both for AnimationCurve and custom eases internal EaseFunction customEase; // Used both for AnimationCurve and custom eases
#pragma warning disable 1591 #pragma warning disable 1591
@ -82,7 +83,8 @@ namespace DG.Tweening
internal Type typeofT1; // Only used by Tweeners internal Type typeofT1; // Only used by Tweeners
internal Type typeofT2; // Only used by Tweeners internal Type typeofT2; // Only used by Tweeners
internal Type typeofTPlugOptions; // Only used by Tweeners internal Type typeofTPlugOptions; // Only used by Tweeners
internal bool active; // FALSE when tween is (or should be) despawned - set only by TweenManager /// <summary>FALSE when tween is (or should be) despawned - set only by TweenManager</summary>
public bool active { get; internal set; } // Required by Modules
internal bool isSequenced; // Set by Sequence when adding a Tween to it internal bool isSequenced; // Set by Sequence when adding a Tween to it
internal Sequence sequenceParent; // Set by Sequence when adding a Tween to it internal Sequence sequenceParent; // Set by Sequence when adding a Tween to it
internal int activeId = -1; // Index inside its active list (touched only by TweenManager) internal int activeId = -1; // Index inside its active list (touched only by TweenManager)
@ -95,8 +97,10 @@ namespace DG.Tweening
internal bool creationLocked; // TRUE after the tween was updated the first time (even if it was delayed), or when added to a Sequence internal bool creationLocked; // TRUE after the tween was updated the first time (even if it was delayed), or when added to a Sequence
internal bool startupDone; // TRUE the first time the actual tween starts, AFTER any delay has elapsed (unless it's a FROM tween) internal bool startupDone; // TRUE the first time the actual tween starts, AFTER any delay has elapsed (unless it's a FROM tween)
internal bool playedOnce; // TRUE after the tween was set in a play state at least once, AFTER any delay is elapsed /// <summary>TRUE after the tween was set in a play state at least once, AFTER any delay is elapsed</summary>
internal float position; // Time position within a single loop cycle public bool playedOnce { get; private set; } // Required by Modules
/// <summary>Time position within a single loop cycle</summary>
public float position { get; internal set; } // Required by Modules
internal float fullDuration; // Total duration loops included internal float fullDuration; // Total duration loops included
internal int completedLoops; internal int completedLoops;
internal bool isPlaying; // Set by TweenManager when getting a new tween internal bool isPlaying; // Set by TweenManager when getting a new tween

View File

@ -20,9 +20,9 @@ namespace DG.Tweening
/// </summary> /// </summary>
public static class ShortcutExtensions46 public static class ShortcutExtensions46
{ {
#region Unity UI #region Unity UI
#region CanvasGroup #region CanvasGroup
/// <summary>Tweens a CanvasGroup's alpha color to the given value. /// <summary>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</summary> /// Also stores the canvasGroup as the tween's target so it can be used for filtered operations</summary>
@ -33,9 +33,9 @@ namespace DG.Tweening
.SetTarget(target); .SetTarget(target);
} }
#endregion #endregion
#region Graphic #region Graphic
/// <summary>Tweens an Graphic's color to the given value. /// <summary>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</summary> /// Also stores the image as the tween's target so it can be used for filtered operations</summary>
@ -54,9 +54,9 @@ namespace DG.Tweening
.SetTarget(target); .SetTarget(target);
} }
#endregion #endregion
#region Image #region Image
/// <summary>Tweens an Image's color to the given value. /// <summary>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</summary> /// Also stores the image as the tween's target so it can be used for filtered operations</summary>
@ -109,9 +109,9 @@ namespace DG.Tweening
return s; return s;
} }
#endregion #endregion
#region LayoutElement #region LayoutElement
/// <summary>Tweens an LayoutElement's flexibleWidth/Height to the given value. /// <summary>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</summary> /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations</summary>
@ -167,9 +167,9 @@ namespace DG.Tweening
.SetOptions(snapping).SetTarget(target); .SetOptions(snapping).SetTarget(target);
} }
#endregion #endregion
#region Outline #region Outline
/// <summary>Tweens a Outline's effectColor to the given value. /// <summary>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</summary> /// Also stores the Outline as the tween's target so it can be used for filtered operations</summary>
@ -197,9 +197,9 @@ namespace DG.Tweening
.SetTarget(target); .SetTarget(target);
} }
#endregion #endregion
#region RectTransform #region RectTransform
/// <summary>Tweens a RectTransform's anchoredPosition to the given value. /// <summary>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</summary> /// Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
@ -366,7 +366,7 @@ namespace DG.Tweening
.SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping); .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping);
} }
#region Special #region Special
/// <summary>Tweens a RectTransform's anchoredPosition to the given value, while also applying a jump effect along the Y axis. /// <summary>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. /// Returns a Sequence instead of a Tweener.
@ -428,11 +428,11 @@ namespace DG.Tweening
// return s; // return s;
} }
#endregion #endregion
#endregion #endregion
#region ScrollRect #region ScrollRect
/// <summary>Tweens a ScrollRect's horizontal/verticalNormalizedPosition to the given value. /// <summary>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</summary> /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations</summary>
@ -474,9 +474,9 @@ namespace DG.Tweening
.SetOptions(snapping).SetTarget(target); .SetOptions(snapping).SetTarget(target);
} }
#endregion #endregion
#region Slider #region Slider
/// <summary>Tweens a Slider's value to the given value. /// <summary>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</summary> /// Also stores the Slider as the tween's target so it can be used for filtered operations</summary>
@ -488,9 +488,9 @@ namespace DG.Tweening
.SetOptions(snapping).SetTarget(target); .SetOptions(snapping).SetTarget(target);
} }
#endregion #endregion
#region Text #region Text
/// <summary>Tweens a Text's color to the given value. /// <summary>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</summary> /// Also stores the Text as the tween's target so it can be used for filtered operations</summary>
@ -525,13 +525,13 @@ namespace DG.Tweening
.SetTarget(target); .SetTarget(target);
} }
#endregion #endregion
#endregion #endregion
#region Blendables #region Blendables
#region Graphic #region Graphic
/// <summary>Tweens a Graphic's color to the given value, /// <summary>Tweens a Graphic's color to the given value,
/// in a way that allows other DOBlendableColor tweens to work together on the same target, /// in a way that allows other DOBlendableColor tweens to work together on the same target,
@ -554,9 +554,9 @@ namespace DG.Tweening
.Blendable().SetTarget(target); .Blendable().SetTarget(target);
} }
#endregion #endregion
#region Image #region Image
/// <summary>Tweens a Image's color to the given value, /// <summary>Tweens a Image's color to the given value,
/// in a way that allows other DOBlendableColor tweens to work together on the same target, /// in a way that allows other DOBlendableColor tweens to work together on the same target,
@ -579,9 +579,9 @@ namespace DG.Tweening
.Blendable().SetTarget(target); .Blendable().SetTarget(target);
} }
#endregion #endregion
#region Text #region Text
/// <summary>Tweens a Text's color BY the given value, /// <summary>Tweens a Text's color BY the given value,
/// in a way that allows other DOBlendableColor tweens to work together on the same target, /// in a way that allows other DOBlendableColor tweens to work together on the same target,
@ -604,8 +604,8 @@ namespace DG.Tweening
.Blendable().SetTarget(target); .Blendable().SetTarget(target);
} }
#endregion #endregion
#endregion #endregion
} }
} }

View File

@ -0,0 +1,229 @@
// Author: Daniele Giardini - http://www.demigiant.com
// Created: 2014/09/30 11:59
//
// License Copyright (c) Daniele Giardini.
// This work is subject to the terms at http://dotween.demigiant.com/license.php
using System;
using System.IO;
using UnityEditor;
using UnityEngine;
namespace DG.DOTweenEditor
{
/// <summary>
/// Not used as menu item anymore, but as a utiity function
/// </summary>
static class DOTweenDefines
{
// Modules
public const string GlobalDefine_AudioModule = "DOTAUDIO";
public const string GlobalDefine_PhysicsModule = "DOTPHYSICS";
public const string GlobalDefine_Physics2DModule = "DOTPHYSICS2D";
public const string GlobalDefine_SpriteModule = "DOTSPRITE";
public const string GlobalDefine_UIModule = "DOTUI";
// External assets defines
public const string GlobalDefine_TK2D = "DOTWEEN_TK2D";
public const string GlobalDefine_TextMeshPro = "DOTWEEN_TMP";
// Legacy (in versions older than 1.2.000)
public const string GlobalDefine_Legacy_NoRigidbody = "DOTWEEN_NORBODY";
// Removes all DOTween defines including the ones for external assets
public static void RemoveAllDefines()
{
EditorUtils.RemoveGlobalDefine(GlobalDefine_AudioModule);
EditorUtils.RemoveGlobalDefine(GlobalDefine_PhysicsModule);
EditorUtils.RemoveGlobalDefine(GlobalDefine_Physics2DModule);
EditorUtils.RemoveGlobalDefine(GlobalDefine_SpriteModule);
EditorUtils.RemoveGlobalDefine(GlobalDefine_UIModule);
EditorUtils.RemoveGlobalDefine(GlobalDefine_Legacy_NoRigidbody);
EditorUtils.RemoveGlobalDefine(GlobalDefine_TK2D);
EditorUtils.RemoveGlobalDefine(GlobalDefine_TextMeshPro);
}
// Removes all legacy defines
public static void RemoveAllLegacyDefines()
{
EditorUtils.RemoveGlobalDefine(GlobalDefine_Legacy_NoRigidbody);
}
// Adds all Unity Modules defines but not the ones for external assets
public static void AddAllUnityDefines()
{
EditorUtils.AddGlobalDefine(GlobalDefine_AudioModule);
EditorUtils.AddGlobalDefine(GlobalDefine_PhysicsModule);
EditorUtils.AddGlobalDefine(GlobalDefine_Physics2DModule);
EditorUtils.AddGlobalDefine(GlobalDefine_SpriteModule);
EditorUtils.AddGlobalDefine(GlobalDefine_UIModule);
}
// // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
// // ███ LEGACY (before Modules) █████████████████████████████████████████████████████████████████████████████████████████
//
// const string _Title = "DOTween Setup";
//
// /// <summary>
// /// Setups DOTween
// /// </summary>
// /// <param name="partiallySilent">If TRUE, no warning window appears in case there is no need for setup</param>
// public static void Setup(bool partiallySilent = false)
// {
// bool setupRequired = EditorUtils.DOTweenSetupRequired();
// if (setupRequired) {
// string msg = "Based on your Unity version (" + Application.unityVersion + ") and eventual plugins, DOTween will now activate additional tween elements, if available.";
// if (!EditorUtility.DisplayDialog(_Title, msg, "Ok", "Cancel")) return;
// } else {
// if (!partiallySilent) {
// string msg = "This project has already been setup for your version of DOTween.\nReimport DOTween if you added new compatible external assets or upgraded your Unity version.";
// if (!EditorUtility.DisplayDialog(_Title, msg, "Force Setup", "Cancel")) return;
// } else return;
// }
//
// string addonsDir = EditorUtils.dotweenDir;
// string proAddonsDir = EditorUtils.dotweenProDir;
//
// EditorUtility.DisplayProgressBar(_Title, "Please wait...", 0.25f);
//
// int totImported = 0;
// // Unity version-based files
// string[] vs = Application.unityVersion.Split("."[0]);
// int majorVersion = Convert.ToInt32(vs[0]);
// int minorVersion = Convert.ToInt32(vs[1]);
// if (majorVersion < 4) {
// SetupComplete(addonsDir, proAddonsDir, totImported);
// return;
// }
// if (majorVersion == 4) {
// if (minorVersion < 3) {
// SetupComplete(addonsDir, proAddonsDir, totImported);
// return;
// }
// totImported += ImportAddons("43", addonsDir);
// if (minorVersion >= 6) totImported += ImportAddons("46", addonsDir);
// } else {
// // 5.x
// totImported += ImportAddons("43", addonsDir);
// totImported += ImportAddons("46", addonsDir);
// totImported += ImportAddons("50", addonsDir);
// }
// // Additional plugin files
// // Pro plugins
// if (EditorUtils.hasPro) {
// // PRO > 2DToolkit shortcuts
// if (Has2DToolkit()) {
// totImported += ImportAddons("Tk2d", proAddonsDir);
// EditorUtils.AddGlobalDefine(GlobalDefine_TK2D);
// } else EditorUtils.RemoveGlobalDefine(GlobalDefine_TK2D);
// // PRO > TextMeshPro shortcuts
// if (HasTextMeshPro()) {
// totImported += ImportAddons("TextMeshPro", proAddonsDir);
// EditorUtils.AddGlobalDefine(GlobalDefine_TextMeshPro);
// } else EditorUtils.RemoveGlobalDefine(GlobalDefine_TextMeshPro);
// }
//
// SetupComplete(addonsDir, proAddonsDir, totImported);
// }
//
// static void SetupComplete(string addonsDir, string proAddonsDir, int totImported)
// {
// int totRemoved = 0;
//
// // Delete all remaining addon files
// string[] leftoverAddonFiles = Directory.GetFiles(addonsDir, "*.addon");
// if (leftoverAddonFiles.Length > 0) {
// EditorUtility.DisplayProgressBar(_Title, "Removing " + leftoverAddonFiles.Length + " unused additional files...", 0.5f);
// foreach (string leftoverAddonFile in leftoverAddonFiles) {
// totRemoved++;
// File.Delete(leftoverAddonFile);
// }
// }
// if (EditorUtils.hasPro) {
// leftoverAddonFiles = Directory.GetFiles(proAddonsDir, "*.addon");
// if (leftoverAddonFiles.Length > 0) {
// EditorUtility.DisplayProgressBar(_Title, "Removing " + leftoverAddonFiles.Length + " unused additional files...", 0.5f);
// foreach (string leftoverAddonFile in leftoverAddonFiles) {
// totRemoved++;
// File.Delete(leftoverAddonFile);
// }
// }
// }
// // Delete all remaining addon meta files
// leftoverAddonFiles = Directory.GetFiles(addonsDir, "*.addon.meta");
// if (leftoverAddonFiles.Length > 0) {
// EditorUtility.DisplayProgressBar(_Title, "Removing " + leftoverAddonFiles.Length + " unused additional meta files...", 0.75f);
// foreach (string leftoverAddonFile in leftoverAddonFiles) {
// File.Delete(leftoverAddonFile);
// }
// }
// if (EditorUtils.hasPro) {
// leftoverAddonFiles = Directory.GetFiles(proAddonsDir, "*.addon.meta");
// if (leftoverAddonFiles.Length > 0) {
// EditorUtility.DisplayProgressBar(_Title, "Removing " + leftoverAddonFiles.Length + " unused additional meta files...", 0.75f);
// foreach (string leftoverAddonFile in leftoverAddonFiles) {
// File.Delete(leftoverAddonFile);
// }
// }
// }
//
// EditorUtility.DisplayProgressBar(_Title, "Refreshing...", 0.9f);
// AssetDatabase.Refresh();
//
// EditorUtility.ClearProgressBar();
// EditorUtility.DisplayDialog(_Title, "DOTween setup is now complete." +
// (totImported == 0 ? "" : "\n" + totImported + " additional libraries were imported or updated.") +
// (totRemoved == 0 ? "" : "\n" + totRemoved + " extra files were removed."),
// "Ok"
// );
// }
//
// // Removes relative .addon extension thus activating files
// static int ImportAddons(string version, string addonsDir)
// {
// bool imported = false;
// string[] filenames = new[] {
// "DOTween" + version + ".dll",
// "DOTween" + version + ".xml",
// "DOTween" + version + ".dll.mdb",
// "DOTween" + version + ".cs"
// };
//
// foreach (string filename in filenames) {
// string addonFilepath = addonsDir + filename + ".addon";
// string finalFilepath = addonsDir + filename;
// if (File.Exists(addonFilepath)) {
// // Delete eventual existing final file
// if (File.Exists(finalFilepath)) File.Delete(finalFilepath);
// // Rename addon file to final
// File.Move(addonFilepath, finalFilepath);
// imported = true;
// }
// }
//
// return imported ? 1 : 0;
// }
//
// static bool Has2DToolkit()
// {
// string[] rootDirs = Directory.GetDirectories(EditorUtils.projectPath, "TK2DROOT", SearchOption.AllDirectories);
// if (rootDirs.Length == 0) return false;
// foreach (string rootDir in rootDirs) {
// if (Directory.GetFiles(rootDir, "tk2dSprite.cs", SearchOption.AllDirectories).Length > 0) return true;
// }
// return false;
// }
// static bool HasTextMeshPro()
// {
// string[] rootDirs = Directory.GetDirectories(EditorUtils.projectPath, "TextMesh Pro", SearchOption.AllDirectories);
// if (rootDirs.Length == 0) return false;
// foreach (string rootDir in rootDirs) {
// if (Directory.GetFiles(rootDir, "TextMeshPro.cs", SearchOption.AllDirectories).Length > 0) return true; // Old payed version
// if (Directory.GetFiles(rootDir, "TextMeshPro*.dll", SearchOption.AllDirectories).Length > 0) return true; // New free version
// }
// return false;
// }
}
}

View File

@ -64,22 +64,24 @@
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="UnityEditor"> <Reference Include="UnityEditor">
<HintPath>C:\Program Files (x86)\Unity 3\Editor\Data\Managed\UnityEditor.dll</HintPath> <HintPath>C:\Program Files (x86)\Unity 46\Editor\Data\Managed\UnityEditor.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="UnityEngine"> <Reference Include="UnityEngine">
<HintPath>C:\Program Files (x86)\Unity 3\Editor\Data\Managed\UnityEngine.dll</HintPath> <HintPath>C:\Program Files (x86)\Unity 46\Editor\Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Core\DelayedCall.cs" /> <Compile Include="DelayedCall.cs" />
<Compile Include="Core\EditorGUIUtils.cs" /> <Compile Include="UI\EditorGUIUtils.cs" />
<Compile Include="Core\EditorUtils.cs" /> <Compile Include="EditorUtils.cs" />
<Compile Include="DOTweenInspector.cs" /> <Compile Include="UI\DOTweenInspector.cs" />
<Compile Include="DOTweenSettingsInspector.cs" /> <Compile Include="UI\DOTweenUtilityWindowModules.cs" />
<Compile Include="DOTweenSetupMenuItem.cs" /> <Compile Include="DOTweenProcessors.cs" />
<Compile Include="DOTweenUtilityWindow.cs" /> <Compile Include="UI\DOTweenSettingsInspector.cs" />
<Compile Include="DOTweenDefines.cs" />
<Compile Include="UI\DOTweenUtilityWindow.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -91,47 +93,7 @@
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>set BinDir=bin.Global\DOTween\Editor <PostBuildEvent>call $(SolutionDir)PostBuild_DOTween.bat $(SolutionDir) $(TargetDir) $(TargetFileName) $(TargetName) DOTween bin Editor</PostBuildEvent>
set DestinationDir=$(SolutionDir)..\..\%25BinDir%25
set BinDirNoMeta=bin.Global_no_meta\DOTween\Editor
set DestinationDirNoMeta=$(SolutionDir)..\..\%25BinDirNoMeta%25
set BinDirUnityTests=UnityTests.Unity4\Assets\Demigiant\DOTween\Editor
set DestinationDirUnityTests=$(SolutionDir)..\%25BinDirUnityTests%25
set BinDirUnity5Tests=UnityTests.Unity5\Assets\Demigiant\DOTween\Editor
set DestinationDirUnity5Tests=$(SolutionDir)..\%25BinDirUnity5Tests%25
set BinDirCompatibilityTests=UnityCompatibilityTests.Unity35\Assets\Demigiant\DOTween\Editor
set DestinationDirCompatibilityTests=$(SolutionDir)..\%25BinDirCompatibilityTests%25
set BinDirExtPluginsTests=ExternalPluginsTestsAndExamples.Unity5\Assets\Demigiant\DOTween\Editor
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\Editor" %25DestinationDir%25 /Y /I /E
echo Exporting Assembly to %25DestinationDirNoMeta%25
echo f | xcopy "$(SolutionDir)\bin\Editor" %25DestinationDirNoMeta%25 /Y /I /E
echo Exporting Assembly to %25DestinationDirUnityTests%25
echo f | xcopy "$(SolutionDir)\bin\Editor" %25DestinationDirUnityTests%25 /Y /I /E
echo Exporting Assembly to %25DestinationDirUnity5Tests%25
echo f | xcopy "$(SolutionDir)\bin\Editor" %25DestinationDirUnity5Tests%25 /Y /I /E
echo Exporting Assembly to %25DestinationDirCompatibilityTests%25
echo f | xcopy "$(SolutionDir)\bin\Editor" %25DestinationDirCompatibilityTests%25 /Y /I /E
echo Exporting Assembly to %25DestinationDirExtPluginsTests%25
echo f | xcopy "$(SolutionDir)\bin\Editor" %25DestinationDirExtPluginsTests%25 /Y /I /E</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -0,0 +1,93 @@
// Author: Daniele Giardini - http://www.demigiant.com
// Created: 2018/07/16 18:07
// License Copyright (c) Daniele Giardini
// This work is subject to the terms at http://dotween.demigiant.com/license.php
using System.IO;
using DG.DOTweenEditor.UI;
using DG.Tweening;
using UnityEditor;
using UnityEngine;
namespace DG.DOTweenEditor
{
public class UtilityWindowModificationProcessor : UnityEditor.AssetModificationProcessor
{
// Checks if deleted folder contains DOTween Pro and in case removes scripting define symbols
static AssetDeleteResult OnWillDeleteAsset(string asset, RemoveAssetOptions options)
{
// Check if asset is a directory
string dir = EditorUtils.ADBPathToFullPath(asset);
if (!Directory.Exists(dir)) return AssetDeleteResult.DidNotDelete;
// Check if directory contains DOTween.dll
string[] files = Directory.GetFiles(dir, "DOTween.dll", SearchOption.AllDirectories);
int len = files.Length;
bool containsDOTween = false;
for (int i = 0; i < len; ++i) {
if (!files[i].EndsWith("DOTween.dll")) continue;
containsDOTween = true;
break;
}
if (!containsDOTween) return AssetDeleteResult.DidNotDelete;
Debug.Log("::: DOTween deleted");
// DOTween is being deleted: deal with it
// Remove EditorPrefs
EditorPrefs.DeleteKey(Application.dataPath + DOTweenUtilityWindow.Id);
EditorPrefs.DeleteKey(Application.dataPath + DOTweenUtilityWindow.IdPro);
// Remove scripting define symbols
DOTweenDefines.RemoveAllDefines();
//
EditorUtility.DisplayDialog("DOTween Deleted",
"DOTween was deleted and all of its scripting define symbols removed." +
"\n\nThis might show an error depending on your previous setup." +
" If this happens, please close and reopen Unity or reimport DOTween.",
"Ok"
);
return AssetDeleteResult.DidNotDelete;
}
}
public class UtilityWindowPostProcessor : AssetPostprocessor
{
static bool _setupDialogRequested; // Used to prevent OnPostProcessAllAssets firing twice (because of a Unity bug/feature)
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
{
if (_setupDialogRequested) return;
string[] dotweenEntries = System.Array.FindAll(importedAssets, name => name.Contains("DOTween") && !name.EndsWith(".meta") && !name.EndsWith(".jpg") && !name.EndsWith(".png"));
bool dotweenImported = dotweenEntries.Length > 0;
if (dotweenImported) {
// Delete old DOTween files
EditorUtils.DeleteLegacyNoModulesDOTweenFiles();
// Delete old DemiLib configuration
EditorUtils.DeleteOldDemiLibCore();
// Remove old legacy defines
DOTweenDefines.RemoveAllLegacyDefines();
//
bool differentCoreVersion = EditorPrefs.GetString(Application.dataPath + DOTweenUtilityWindow.Id) != Application.dataPath + DOTween.Version;
bool differentProVersion = EditorUtils.hasPro && EditorPrefs.GetString(Application.dataPath + DOTweenUtilityWindow.IdPro) != Application.dataPath + EditorUtils.proVersion;
bool setupRequired = differentCoreVersion || differentProVersion;
if (setupRequired) {
_setupDialogRequested = true;
EditorPrefs.SetString(Application.dataPath + DOTweenUtilityWindow.Id, Application.dataPath + DOTween.Version);
if (EditorUtils.hasPro) EditorPrefs.SetString(Application.dataPath + DOTweenUtilityWindow.IdPro, Application.dataPath + EditorUtils.proVersion);
// EditorUtility.DisplayDialog("DOTween",
// differentCoreVersion
// ? "New version of DOTween imported." +
// "\n\nSelect \"Setup DOTween...\" in DOTween's Utility Panel to add/remove Modules."
// : "New version of DOTween Pro imported." +
// " \n\nSelect \"Setup DOTween...\" in DOTween's Utility Panel to add/remove external Modules (TextMesh Pro/2DToolkit/etc).",
// "Ok"
// );
DOTweenUtilityWindow.Open();
// Opening window after a postProcess doesn't work on Unity 3 so check that
// string[] vs = Application.unityVersion.Split("."[0]);
// int majorVersion = System.Convert.ToInt32(vs[0]);
// if (majorVersion >= 4) EditorUtils.DelayedCall(0.5f, DOTweenUtilityWindow.Open);
// EditorUtils.DelayedCall(8, ()=> _setupDialogRequested = false);
}
}
}
}
}

View File

@ -1,217 +0,0 @@
// Author: Daniele Giardini - http://www.demigiant.com
// Created: 2014/09/30 11:59
//
// License Copyright (c) Daniele Giardini.
// This work is subject to the terms at http://dotween.demigiant.com/license.php
using System;
using System.IO;
using System.Reflection;
using DG.DOTweenEditor.Core;
using UnityEditor;
using UnityEngine;
namespace DG.DOTweenEditor
{
/// <summary>
/// Not used as menu item anymore, but as a utiity function
/// </summary>
class DOTweenSetupMenuItem
{
public const string GlobalDefine_TK2D = "DOTWEEN_TK2D";
public const string GlobalDefine_TextMeshPro = "DOTWEEN_TMP";
public const string GlobalDefine_NoRigidbody = "DOTWEEN_NORBODY";
const string _Title = "DOTween Setup";
static Assembly _proEditorAssembly;
/// <summary>
/// Setups DOTween
/// </summary>
/// <param name="partiallySilent">If TRUE, no warning window appears in case there is no need for setup</param>
public static void Setup(bool partiallySilent = false)
{
bool setupRequired = EditorUtils.DOTweenSetupRequired();
if (setupRequired) {
string msg = "Based on your Unity version (" + Application.unityVersion + ") and eventual plugins, DOTween will now activate additional tween elements, if available.";
if (!EditorUtility.DisplayDialog(_Title, msg, "Ok", "Cancel")) return;
} else {
if (!partiallySilent) {
string msg = "This project has already been setup for your version of DOTween.\nReimport DOTween if you added new compatible external assets or upgraded your Unity version.";
if (!EditorUtility.DisplayDialog(_Title, msg, "Force Setup", "Cancel")) return;
} else return;
}
string addonsDir = EditorUtils.dotweenDir;
string proAddonsDir = EditorUtils.dotweenProDir;
EditorUtility.DisplayProgressBar(_Title, "Please wait...", 0.25f);
int totImported = 0;
// Unity version-based files
string[] vs = Application.unityVersion.Split("."[0]);
int majorVersion = Convert.ToInt32(vs[0]);
int minorVersion = Convert.ToInt32(vs[1]);
if (majorVersion < 4) {
SetupComplete(addonsDir, proAddonsDir, totImported);
return;
}
if (majorVersion == 4) {
if (minorVersion < 3) {
SetupComplete(addonsDir, proAddonsDir, totImported);
return;
}
totImported += ImportAddons("43", addonsDir);
if (minorVersion >= 6) totImported += ImportAddons("46", addonsDir);
} else {
// 5.x
totImported += ImportAddons("43", addonsDir);
totImported += ImportAddons("46", addonsDir);
totImported += ImportAddons("50", addonsDir);
}
// Additional plugin files
// Pro plugins
if (EditorUtils.hasPro) {
// PRO > 2DToolkit shortcuts
if (Has2DToolkit()) {
totImported += ImportAddons("Tk2d", proAddonsDir);
ProEditor_AddGlobalDefine(GlobalDefine_TK2D);
} else ProEditor_RemoveGlobalDefine(GlobalDefine_TK2D);
// PRO > TextMeshPro shortcuts
if (HasTextMeshPro()) {
totImported += ImportAddons("TextMeshPro", proAddonsDir);
ProEditor_AddGlobalDefine(GlobalDefine_TextMeshPro);
} else ProEditor_RemoveGlobalDefine(GlobalDefine_TextMeshPro);
// PRO > Rigidbody inclusion
#if RIGIDBODY
ProEditor_RemoveGlobalDefine(GlobalDefine_NoRigidbody);
#else
totImported += ImportAddons("TextMeshPro", proAddonsDir);
ProEditor_AddGlobalDefine(GlobalDefine_NoRigidbody);
#endif
}
SetupComplete(addonsDir, proAddonsDir, totImported);
}
// Uses reflection to call DOTweenPro's AddGlobalDefine method (because older version of Unity didn't have it)
public static void ProEditor_AddGlobalDefine(string id)
{
if (!EditorUtils.hasPro || ProEditorAssembly() == null) return;
Type type = _proEditorAssembly.GetType("DG.DOTweenEditor.Core.ProEditorUtils");
type.GetMethod("AddGlobalDefine", BindingFlags.Public | BindingFlags.Static).Invoke(null, new object[] { id });
}
// Uses reflection to call DOTweenPro's RemoveGlobalDefine method (because older version of Unity didn't have it)
public static void ProEditor_RemoveGlobalDefine(string id)
{
if (!EditorUtils.hasPro || ProEditorAssembly() == null) return;
Type type = _proEditorAssembly.GetType("DG.DOTweenEditor.Core.ProEditorUtils");
type.GetMethod("RemoveGlobalDefine", BindingFlags.Public | BindingFlags.Static).Invoke(null, new object[] { id });
}
static void SetupComplete(string addonsDir, string proAddonsDir, int totImported)
{
int totRemoved = 0;
// Delete all remaining addon files
string[] leftoverAddonFiles = Directory.GetFiles(addonsDir, "*.addon");
if (leftoverAddonFiles.Length > 0) {
EditorUtility.DisplayProgressBar(_Title, "Removing " + leftoverAddonFiles.Length + " unused additional files...", 0.5f);
foreach (string leftoverAddonFile in leftoverAddonFiles) {
totRemoved++;
File.Delete(leftoverAddonFile);
}
}
if (EditorUtils.hasPro) {
leftoverAddonFiles = Directory.GetFiles(proAddonsDir, "*.addon");
if (leftoverAddonFiles.Length > 0) {
EditorUtility.DisplayProgressBar(_Title, "Removing " + leftoverAddonFiles.Length + " unused additional files...", 0.5f);
foreach (string leftoverAddonFile in leftoverAddonFiles) {
totRemoved++;
File.Delete(leftoverAddonFile);
}
}
}
// Delete all remaining addon meta files
leftoverAddonFiles = Directory.GetFiles(addonsDir, "*.addon.meta");
if (leftoverAddonFiles.Length > 0) {
EditorUtility.DisplayProgressBar(_Title, "Removing " + leftoverAddonFiles.Length + " unused additional meta files...", 0.75f);
foreach (string leftoverAddonFile in leftoverAddonFiles) {
File.Delete(leftoverAddonFile);
}
}
if (EditorUtils.hasPro) {
leftoverAddonFiles = Directory.GetFiles(proAddonsDir, "*.addon.meta");
if (leftoverAddonFiles.Length > 0) {
EditorUtility.DisplayProgressBar(_Title, "Removing " + leftoverAddonFiles.Length + " unused additional meta files...", 0.75f);
foreach (string leftoverAddonFile in leftoverAddonFiles) {
File.Delete(leftoverAddonFile);
}
}
}
EditorUtility.DisplayProgressBar(_Title, "Refreshing...", 0.9f);
AssetDatabase.Refresh();
EditorUtility.ClearProgressBar();
EditorUtility.DisplayDialog(_Title, "DOTween setup is now complete." +
(totImported == 0 ? "" : "\n" + totImported + " additional libraries were imported or updated.") +
(totRemoved == 0 ? "" : "\n" + totRemoved + " extra files were removed."),
"Ok"
);
}
// Removes relative .addon extension thus activating files
static int ImportAddons(string version, string addonsDir)
{
bool imported = false;
string[] filenames = new[] {
"DOTween" + version + ".dll",
"DOTween" + version + ".xml",
"DOTween" + version + ".dll.mdb",
"DOTween" + version + ".cs"
};
foreach (string filename in filenames) {
string addonFilepath = addonsDir + filename + ".addon";
string finalFilepath = addonsDir + filename;
if (File.Exists(addonFilepath)) {
// Delete eventual existing final file
if (File.Exists(finalFilepath)) File.Delete(finalFilepath);
// Rename addon file to final
File.Move(addonFilepath, finalFilepath);
imported = true;
}
}
return imported ? 1 : 0;
}
static bool Has2DToolkit()
{
string[] rootDirs = Directory.GetDirectories(EditorUtils.projectPath, "TK2DROOT", SearchOption.AllDirectories);
if (rootDirs.Length == 0) return false;
foreach (string rootDir in rootDirs) {
if (Directory.GetFiles(rootDir, "tk2dSprite.cs", SearchOption.AllDirectories).Length > 0) return true;
}
return false;
}
static bool HasTextMeshPro()
{
string[] rootDirs = Directory.GetDirectories(EditorUtils.projectPath, "TextMesh Pro", SearchOption.AllDirectories);
if (rootDirs.Length == 0) return false;
foreach (string rootDir in rootDirs) {
if (Directory.GetFiles(rootDir, "TextMeshPro.cs", SearchOption.AllDirectories).Length > 0) return true; // Old payed version
if (Directory.GetFiles(rootDir, "TextMeshPro*.dll", SearchOption.AllDirectories).Length > 0) return true; // New free version
}
return false;
}
static Assembly ProEditorAssembly()
{
if (_proEditorAssembly == null) _proEditorAssembly = Assembly.LoadFile(EditorUtils.dotweenProDir + "Editor" + EditorUtils.pathSlash + "DOTweenProEditor.dll");
return _proEditorAssembly;
}
}
}

View File

@ -5,7 +5,7 @@ using System;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;
namespace DG.DOTweenEditor.Core namespace DG.DOTweenEditor
{ {
public class DelayedCall public class DelayedCall
{ {

View File

@ -2,14 +2,14 @@
// Created: 2014/12/24 13:50 // Created: 2014/12/24 13:50
using System; using System;
using System.Collections;
using System.Reflection;
using System.IO; using System.IO;
using System.Reflection;
using System.Text;
using DG.Tweening; using DG.Tweening;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;
namespace DG.DOTweenEditor.Core namespace DG.DOTweenEditor
{ {
public static class EditorUtils public static class EditorUtils
{ {
@ -29,6 +29,7 @@ namespace DG.DOTweenEditor.Core
public static string pathSlash { get; private set; } // for full paths public static string pathSlash { get; private set; } // for full paths
public static string pathSlashToReplace { get; private set; } // for full paths public static string pathSlashToReplace { get; private set; } // for full paths
static readonly StringBuilder _Strb = new StringBuilder();
static bool _hasPro; static bool _hasPro;
static string _proVersion; static string _proVersion;
static bool _hasCheckedForPro; static bool _hasCheckedForPro;
@ -79,12 +80,60 @@ namespace DG.DOTweenEditor.Core
} }
/// <summary> /// <summary>
/// Returns TRUE if addons setup is required. /// Returns TRUE if setup is required
/// </summary> /// </summary>
public static bool DOTweenSetupRequired() public static bool DOTweenSetupRequired()
{ {
if (!Directory.Exists(dotweenDir)) return false; // Can happen if we were deleting DOTween if (!Directory.Exists(dotweenDir)) return false;
return Directory.GetFiles(dotweenDir, "*.addon").Length > 0 || hasPro && Directory.GetFiles(dotweenProDir, "*.addon").Length > 0; return Directory.GetFiles(dotweenDir + "Editor", "DOTweenUpgradeManager.*").Length > 0;
// Legacy methods
// if (!Directory.Exists(dotweenDir)) return false; // Can happen if we were deleting DOTween
// return Directory.GetFiles(dotweenDir, "*.addon").Length > 0 || hasPro && Directory.GetFiles(dotweenProDir, "*.addon").Length > 0;
}
// Deletes DOTweenUpgradeManager files
public static void DeleteDOTweenUpgradeManagerFiles()
{
string adbDOTweenDir = FullPathToADBPath(dotweenDir);
AssetDatabase.StartAssetEditing();
DeleteAssetsIfExist(new[] {
adbDOTweenDir + "Editor/DOTweenUpgradeManager.dll",
adbDOTweenDir + "Editor/DOTweenUpgradeManager.xml",
adbDOTweenDir + "Editor/DOTweenUpgradeManager.dll.mdb"
});
AssetDatabase.StopAssetEditing();
}
// Deletes the files used in older versions of DOTween where Modules still didn't exist
public static void DeleteLegacyNoModulesDOTweenFiles()
{
string adbDOTweenDir = FullPathToADBPath(dotweenDir);
AssetDatabase.StartAssetEditing();
DeleteAssetsIfExist(new[] {
adbDOTweenDir + "DOTween43.dll",
adbDOTweenDir + "DOTween43.xml",
adbDOTweenDir + "DOTween43.dll.mdb",
adbDOTweenDir + "DOTween43.dll.addon",
adbDOTweenDir + "DOTween43.xml.addon",
adbDOTweenDir + "DOTween43.dll.mdb.addon",
adbDOTweenDir + "DOTween46.dll",
adbDOTweenDir + "DOTween46.xml",
adbDOTweenDir + "DOTween46.dll.mdb",
adbDOTweenDir + "DOTween46.dll.addon",
adbDOTweenDir + "DOTween46.xml.addon",
adbDOTweenDir + "DOTween46.dll.mdb.addon",
adbDOTweenDir + "DOTween50.dll",
adbDOTweenDir + "DOTween50.xml",
adbDOTweenDir + "DOTween50.dll.mdb",
adbDOTweenDir + "DOTween50.dll.addon",
adbDOTweenDir + "DOTween50.xml.addon",
adbDOTweenDir + "DOTween50.dll.mdb.addon",
//
adbDOTweenDir + "DOTweenTextMeshPro.cs.addon",
adbDOTweenDir + "DOTweenTk2d.cs.addon",
});
AssetDatabase.StopAssetEditing();
} }
// Deletes old DemiLib core if new one (inside Core directory) exists // Deletes old DemiLib core if new one (inside Core directory) exists
@ -117,6 +166,7 @@ namespace DG.DOTweenEditor.Core
AssetDatabase.ImportAsset(demiLibNewCoreDir, ImportAssetOptions.ImportRecursive); AssetDatabase.ImportAsset(demiLibNewCoreDir, ImportAssetOptions.ImportRecursive);
} }
} }
static void DeleteAssetsIfExist(string[] adbFilePaths) static void DeleteAssetsIfExist(string[] adbFilePaths)
{ {
foreach (string f in adbFilePaths) { foreach (string f in adbFilePaths) {
@ -206,6 +256,74 @@ namespace DG.DOTweenEditor.Core
return Path.GetFullPath(assembly.Location); return Path.GetFullPath(assembly.Location);
} }
/// <summary>
/// Adds the given global define if it's not already present
/// </summary>
public static void AddGlobalDefine(string id)
{
bool added = false;
int totGroupsModified = 0;
BuildTargetGroup[] targetGroups = (BuildTargetGroup[])Enum.GetValues(typeof(BuildTargetGroup));
foreach(BuildTargetGroup btg in targetGroups) {
if (!IsValidBuildTargetGroup(btg)) continue;
string defs = PlayerSettings.GetScriptingDefineSymbolsForGroup(btg);
string[] singleDefs = defs.Split(';');
if (Array.IndexOf(singleDefs, id) != -1) continue; // Already present
added = true;
totGroupsModified++;
defs += defs.Length > 0 ? ";" + id : id;
PlayerSettings.SetScriptingDefineSymbolsForGroup(btg, defs);
}
if (added) Debug.Log(string.Format("DOTween : added global define \"{0}\" to {1} BuildTargetGroups", id, totGroupsModified));
}
/// <summary>
/// Removes the given global define if it's present
/// </summary>
public static void RemoveGlobalDefine(string id)
{
bool removed = false;
int totGroupsModified = 0;
BuildTargetGroup[] targetGroups = (BuildTargetGroup[])Enum.GetValues(typeof(BuildTargetGroup));
foreach(BuildTargetGroup btg in targetGroups) {
if (!IsValidBuildTargetGroup(btg)) continue;
string defs = PlayerSettings.GetScriptingDefineSymbolsForGroup(btg);
string[] singleDefs = defs.Split(';');
if (Array.IndexOf(singleDefs, id) == -1) continue; // Not present
removed = true;
totGroupsModified++;
_Strb.Length = 0;
for (int i = 0; i < singleDefs.Length; ++i) {
if (singleDefs[i] == id) continue;
if (_Strb.Length > 0) _Strb.Append(';');
_Strb.Append(singleDefs[i]);
}
PlayerSettings.SetScriptingDefineSymbolsForGroup(btg, _Strb.ToString());
}
_Strb.Length = 0;
if (removed) Debug.Log(string.Format("DOTween : removed global define \"{0}\" from {1} BuildTargetGroups", id, totGroupsModified));
}
/// <summary>
/// Returns TRUE if the given global define is present in all the <see cref="BuildTargetGroup"/>
/// or only in the given <see cref="BuildTargetGroup"/>, depending on passed parameters.<para/>
/// </summary>
/// <param name="id"></param>
/// <param name="buildTargetGroup"><see cref="BuildTargetGroup"/>to use. Leave NULL to check in all of them.</param>
public static bool HasGlobalDefine(string id, BuildTargetGroup? buildTargetGroup = null)
{
BuildTargetGroup[] targetGroups = buildTargetGroup == null
? (BuildTargetGroup[])Enum.GetValues(typeof(BuildTargetGroup))
: new[] {(BuildTargetGroup)buildTargetGroup};
foreach(BuildTargetGroup btg in targetGroups) {
if (!IsValidBuildTargetGroup(btg)) continue;
string defs = PlayerSettings.GetScriptingDefineSymbolsForGroup(btg);
string[] singleDefs = defs.Split(';');
if (Array.IndexOf(singleDefs, id) != -1) return true;
}
return false;
}
// =================================================================================== // ===================================================================================
// METHODS --------------------------------------------------------------------------- // METHODS ---------------------------------------------------------------------------
@ -260,5 +378,28 @@ namespace DG.DOTweenEditor.Core
T data = ScriptableObject.CreateInstance<T>(); T data = ScriptableObject.CreateInstance<T>();
AssetDatabase.CreateAsset(data, adbFilePath); AssetDatabase.CreateAsset(data, adbFilePath);
} }
static bool IsValidBuildTargetGroup(BuildTargetGroup group)
{
if (group == BuildTargetGroup.Unknown) return false;
Type moduleManager = Type.GetType("UnityEditor.Modules.ModuleManager, UnityEditor.dll");
// MethodInfo miIsPlatformSupportLoaded = moduleManager.GetMethod("IsPlatformSupportLoaded", BindingFlags.Static | BindingFlags.NonPublic);
MethodInfo miGetTargetStringFromBuildTargetGroup = moduleManager.GetMethod(
"GetTargetStringFromBuildTargetGroup", BindingFlags.Static | BindingFlags.NonPublic
);
MethodInfo miGetPlatformName = typeof(PlayerSettings).GetMethod(
"GetPlatformName", BindingFlags.Static | BindingFlags.NonPublic
);
string targetString = (string)miGetTargetStringFromBuildTargetGroup.Invoke(null, new object[] {group});
string platformName = (string)miGetPlatformName.Invoke(null, new object[] {group});
// Group is valid if at least one betweeen targetString and platformName is not empty.
// This seems to me the safest and more reliant way to check,
// since ModuleManager.IsPlatformSupportLoaded dosn't work well with BuildTargetGroup (only BuildTarget)
bool isValid = !string.IsNullOrEmpty(targetString) || !string.IsNullOrEmpty(platformName);
// Debug.Log((isValid ? "<color=#00ff00>" : "<color=#ff0000>") + group + " > " + targetString + " / " + platformName + " > " + isValid + "/" + miIsPlatformSupportLoaded.Invoke(null, new object[] {group.ToString()}) + "</color>");
return isValid;
}
} }
} }

View File

@ -4,17 +4,13 @@
// License Copyright (c) Daniele Giardini. // License Copyright (c) Daniele Giardini.
// This work is subject to the terms at http://dotween.demigiant.com/license.php // This work is subject to the terms at http://dotween.demigiant.com/license.php
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text; using System.Text;
using DG.DOTweenEditor.Core;
using DG.Tweening; using DG.Tweening;
using DG.Tweening.Core; using DG.Tweening.Core;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;
namespace DG.DOTweenEditor namespace DG.DOTweenEditor.UI
{ {
[CustomEditor(typeof(DOTweenComponent))] [CustomEditor(typeof(DOTweenComponent))]
public class DOTweenInspector : Editor public class DOTweenInspector : Editor

View File

@ -3,9 +3,8 @@
using DG.Tweening.Core; using DG.Tweening.Core;
using UnityEditor; using UnityEditor;
using UnityEngine;
namespace DG.DOTweenEditor namespace DG.DOTweenEditor.UI
{ {
[CustomEditor(typeof(DOTweenSettings))] [CustomEditor(typeof(DOTweenSettings))]
public class DOTweenSettingsInspector : Editor public class DOTweenSettingsInspector : Editor
@ -22,11 +21,11 @@ namespace DG.DOTweenEditor
override public void OnInspectorGUI() override public void OnInspectorGUI()
{ {
GUI.enabled = false; UnityEngine.GUI.enabled = false;
DrawDefaultInspector(); DrawDefaultInspector();
GUI.enabled = true; UnityEngine.GUI.enabled = true;
} }
} }
} }

View File

@ -2,82 +2,14 @@
// Created: 2014/12/24 13:37 // Created: 2014/12/24 13:37
using System.IO; using System.IO;
using System.Reflection;
using DG.DOTweenEditor.Core;
using DG.Tweening; using DG.Tweening;
using DG.Tweening.Core; using DG.Tweening.Core;
using DG.Tweening.Core.Enums; using DG.Tweening.Core.Enums;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;
namespace DG.DOTweenEditor namespace DG.DOTweenEditor.UI
{ {
public class UtilityWindowModificationProcessor : AssetModificationProcessor
{
// Checks if deleted folder contains DOTween Pro and in case removes scripting define symbols
static AssetDeleteResult OnWillDeleteAsset(string asset, RemoveAssetOptions options)
{
// Check if asset is a directory
string dir = EditorUtils.ADBPathToFullPath(asset);
if (!Directory.Exists(dir)) return AssetDeleteResult.DidNotDelete;
// Check if directory contains DOTweenPro.dll
string[] files = Directory.GetFiles(dir, "DOTween.dll", SearchOption.AllDirectories);
int len = files.Length;
bool containsDOTween = false;
for (int i = 0; i < len; ++i) {
if (!files[i].EndsWith("DOTween.dll")) continue;
containsDOTween = true;
break;
}
if (!containsDOTween) return AssetDeleteResult.DidNotDelete;
// DOTween found: remove scripting define symbols
DOTweenSetupMenuItem.ProEditor_RemoveGlobalDefine(DOTweenSetupMenuItem.GlobalDefine_TK2D);
DOTweenSetupMenuItem.ProEditor_RemoveGlobalDefine(DOTweenSetupMenuItem.GlobalDefine_TextMeshPro);
DOTweenSetupMenuItem.ProEditor_RemoveGlobalDefine(DOTweenSetupMenuItem.GlobalDefine_NoRigidbody);
EditorUtility.DisplayDialog("DOTween Deleted", "DOTween was deleted and any of its scripting define symbols removed.\nThis might show an error depending on your previous setup. If this happens, please close and reopen Unity or reimport DOTween.", "Ok");
return AssetDeleteResult.DidNotDelete;
}
}
public class UtilityWindowPostProcessor : AssetPostprocessor
{
static bool _setupDialogRequested; // Used to prevent OnPostProcessAllAssets firing twice (because of a Unity bug/feature)
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
{
if (_setupDialogRequested) return;
string[] dotweenEntries = System.Array.FindAll(importedAssets, name => name.Contains("DOTween") && !name.EndsWith(".meta") && !name.EndsWith(".jpg") && !name.EndsWith(".png"));
bool dotweenImported = dotweenEntries.Length > 0;
if (dotweenImported) {
// Delete old DemiLib configuration
EditorUtils.DeleteOldDemiLibCore();
// Setup rigidbody/no rigidbody version
#if RIGIDBODY
DOTweenSetupMenuItem.ProEditor_RemoveGlobalDefine(DOTweenSetupMenuItem.GlobalDefine_NoRigidbody);
#else
DOTweenSetupMenuItem.ProEditor_AddGlobalDefine(DOTweenSetupMenuItem.GlobalDefine_NoRigidbody);
#endif
//
bool openSetupDialog = EditorUtils.DOTweenSetupRequired()
&& (EditorPrefs.GetString(Application.dataPath + DOTweenUtilityWindow.Id) != Application.dataPath + DOTween.Version
|| EditorPrefs.GetString(Application.dataPath + DOTweenUtilityWindow.IdPro) != Application.dataPath + EditorUtils.proVersion);
if (openSetupDialog) {
_setupDialogRequested = true;
EditorPrefs.SetString(Application.dataPath + DOTweenUtilityWindow.Id, Application.dataPath + DOTween.Version);
EditorPrefs.SetString(Application.dataPath + DOTweenUtilityWindow.IdPro, Application.dataPath + EditorUtils.proVersion);
EditorUtility.DisplayDialog("DOTween", "DOTween needs to be setup.\n\nSelect \"Tools > DOTween Utility Panel\" and press \"Setup DOTween...\" in the panel that opens.", "Ok");
// Opening window after a postProcess doesn't work on Unity 3 so check that
string[] vs = Application.unityVersion.Split("."[0]);
int majorVersion = System.Convert.ToInt32(vs[0]);
if (majorVersion >= 4) EditorUtils.DelayedCall(0.5f, DOTweenUtilityWindow.Open);
EditorUtils.DelayedCall(8, ()=> _setupDialogRequested = false);
}
}
}
}
class DOTweenUtilityWindow : EditorWindow class DOTweenUtilityWindow : EditorWindow
{ {
[MenuItem("Tools/Demigiant/" + _Title)] [MenuItem("Tools/Demigiant/" + _Title)]
@ -89,6 +21,7 @@ namespace DG.DOTweenEditor
public const string IdPro = "DOTweenProVersion"; public const string IdPro = "DOTweenProVersion";
static readonly float _HalfBtSize = _WinSize.x * 0.5f - 6; static readonly float _HalfBtSize = _WinSize.x * 0.5f - 6;
bool _initialized;
DOTweenSettings _src; DOTweenSettings _src;
Texture2D _headerImg, _footerImg; Texture2D _headerImg, _footerImg;
Vector2 _headerSize, _footerSize; Vector2 _headerSize, _footerSize;
@ -96,6 +29,7 @@ namespace DG.DOTweenEditor
bool _setupRequired; bool _setupRequired;
int _selectedTab; int _selectedTab;
bool _isModulesMode;
string[] _tabLabels = new[] { "Setup", "Preferences" }; string[] _tabLabels = new[] { "Setup", "Preferences" };
string[] _settingsLocation = new[] {"Assets > Resources", "DOTween > Resources", "Demigiant > Resources"}; string[] _settingsLocation = new[] {"Assets > Resources", "DOTween > Resources", "Demigiant > Resources"};
@ -111,6 +45,26 @@ namespace DG.DOTweenEditor
EditorPrefs.SetString(IdPro, EditorUtils.proVersion); EditorPrefs.SetString(IdPro, EditorUtils.proVersion);
} }
// Returns TRUE if DOTween is initialized
bool Init()
{
if (_initialized) return true;
if (_headerImg == null) {
_headerImg = AssetDatabase.LoadAssetAtPath("Assets/" + EditorUtils.editorADBDir + "Imgs/Header.jpg", typeof(Texture2D)) as Texture2D;
if (_headerImg == null) return false; // DOTween imported for the first time and images not yet imported
EditorUtils.SetEditorTexture(_headerImg, FilterMode.Bilinear, 512);
_headerSize.x = _WinSize.x;
_headerSize.y = (int)((_WinSize.x * _headerImg.height) / _headerImg.width);
_footerImg = AssetDatabase.LoadAssetAtPath("Assets/" + EditorUtils.editorADBDir + (EditorGUIUtility.isProSkin ? "Imgs/Footer.png" : "Imgs/Footer_dark.png"), typeof(Texture2D)) as Texture2D;
EditorUtils.SetEditorTexture(_footerImg, FilterMode.Bilinear, 256);
_footerSize.x = _WinSize.x;
_footerSize.y = (int)((_WinSize.x * _footerImg.height) / _footerImg.width);
}
_initialized = true;
return true;
}
// =================================================================================== // ===================================================================================
// UNITY METHODS --------------------------------------------------------------------- // UNITY METHODS ---------------------------------------------------------------------
@ -127,22 +81,23 @@ namespace DG.DOTweenEditor
if (EditorUtils.hasPro) _innerTitle += "\nDOTweenPro v" + EditorUtils.proVersion; if (EditorUtils.hasPro) _innerTitle += "\nDOTweenPro v" + EditorUtils.proVersion;
else _innerTitle += "\nDOTweenPro not installed"; else _innerTitle += "\nDOTweenPro not installed";
if (_headerImg == null) { Init();
_headerImg = AssetDatabase.LoadAssetAtPath("Assets/" + EditorUtils.editorADBDir + "Imgs/Header.jpg", typeof(Texture2D)) as Texture2D;
EditorUtils.SetEditorTexture(_headerImg, FilterMode.Bilinear, 512);
_headerSize.x = _WinSize.x;
_headerSize.y = (int)((_WinSize.x * _headerImg.height) / _headerImg.width);
_footerImg = AssetDatabase.LoadAssetAtPath("Assets/" + EditorUtils.editorADBDir + (EditorGUIUtility.isProSkin ? "Imgs/Footer.png" : "Imgs/Footer_dark.png"), typeof(Texture2D)) as Texture2D;
EditorUtils.SetEditorTexture(_footerImg, FilterMode.Bilinear, 256);
_footerSize.x = _WinSize.x;
_footerSize.y = (int)((_WinSize.x * _footerImg.height) / _footerImg.width);
}
_setupRequired = EditorUtils.DOTweenSetupRequired(); _setupRequired = EditorUtils.DOTweenSetupRequired();
} }
void OnDisable()
{
_isModulesMode = false;
}
void OnGUI() void OnGUI()
{ {
if (!Init()) {
GUILayout.Space(8);
GUILayout.Label("Completing import process...");
return;
}
Connect(); Connect();
EditorGUIUtils.SetGUIStyles(_footerSize); EditorGUIUtils.SetGUIStyles(_footerSize);
@ -153,9 +108,15 @@ namespace DG.DOTweenEditor
GUILayout.Label("DOTween Utility Panel\nis disabled while in Play Mode", EditorGUIUtils.wrapCenterLabelStyle, GUILayout.ExpandWidth(true)); GUILayout.Label("DOTween Utility Panel\nis disabled while in Play Mode", EditorGUIUtils.wrapCenterLabelStyle, GUILayout.ExpandWidth(true));
GUILayout.Space(40); GUILayout.Space(40);
GUILayout.EndHorizontal(); GUILayout.EndHorizontal();
} else {
if (_isModulesMode) {
if (DOTweenUtilityWindowModules.Draw()) {
_setupRequired = EditorUtils.DOTweenSetupRequired();
_isModulesMode = false;
}
} else { } else {
Rect areaRect = new Rect(0, 0, _headerSize.x, 30); Rect areaRect = new Rect(0, 0, _headerSize.x, 30);
_selectedTab = GUI.Toolbar(areaRect, _selectedTab, _tabLabels); _selectedTab = UnityEngine.GUI.Toolbar(areaRect, _selectedTab, _tabLabels);
switch (_selectedTab) { switch (_selectedTab) {
case 1: case 1:
@ -167,6 +128,7 @@ namespace DG.DOTweenEditor
} }
} }
} }
}
// =================================================================================== // ===================================================================================
// GUI METHODS ----------------------------------------------------------------------- // GUI METHODS -----------------------------------------------------------------------
@ -174,38 +136,50 @@ namespace DG.DOTweenEditor
void DrawSetupGUI() void DrawSetupGUI()
{ {
Rect areaRect = new Rect(0, 30, _headerSize.x, _headerSize.y); Rect areaRect = new Rect(0, 30, _headerSize.x, _headerSize.y);
GUI.DrawTexture(areaRect, _headerImg, ScaleMode.StretchToFill, false); UnityEngine.GUI.DrawTexture(areaRect, _headerImg, ScaleMode.StretchToFill, false);
GUILayout.Space(areaRect.y + _headerSize.y + 2); GUILayout.Space(areaRect.y + _headerSize.y + 2);
GUILayout.Label(_innerTitle, DOTween.isDebugBuild ? EditorGUIUtils.redLabelStyle : EditorGUIUtils.boldLabelStyle); GUILayout.Label(_innerTitle, DOTween.isDebugBuild ? EditorGUIUtils.redLabelStyle : EditorGUIUtils.boldLabelStyle);
if (_setupRequired) { if (_setupRequired) {
GUI.backgroundColor = Color.red; UnityEngine.GUI.backgroundColor = Color.red;
GUILayout.BeginVertical(GUI.skin.box); GUILayout.BeginVertical(UnityEngine.GUI.skin.box);
GUILayout.Label("DOTWEEN SETUP REQUIRED", EditorGUIUtils.setupLabelStyle); GUILayout.Label("DOTWEEN SETUP REQUIRED", EditorGUIUtils.setupLabelStyle);
GUILayout.EndVertical(); GUILayout.EndVertical();
GUI.backgroundColor = Color.white; UnityEngine.GUI.backgroundColor = Color.white;
} else GUILayout.Space(8); } else GUILayout.Space(8);
#if RIGIDBODY UnityEngine.GUI.color = Color.green;
if (GUILayout.Button("Setup DOTween...", EditorGUIUtils.btStyle)) { GUILayout.BeginHorizontal();
#else GUILayout.FlexibleSpace();
if (GUILayout.Button("Setup DOTween (No Rigidbody Version)...", EditorGUIUtils.btStyle)) { if (GUILayout.Button("<b>Setup DOTween...</b>\n(add/remove Modules)", EditorGUIUtils.btSetup)) {
#endif // DOTweenDefines.Setup();
DOTweenSetupMenuItem.Setup(); // _setupRequired = EditorUtils.DOTweenSetupRequired();
_setupRequired = EditorUtils.DOTweenSetupRequired(); DOTweenUtilityWindowModules.Refresh();
_isModulesMode = true;
EditorUtils.DeleteLegacyNoModulesDOTweenFiles();
EditorUtils.DeleteDOTweenUpgradeManagerFiles();
return;
} }
GUILayout.FlexibleSpace();
UnityEngine.GUI.color = Color.white;
GUILayout.EndHorizontal();
GUILayout.Space(8);
EditorGUILayout.HelpBox( // EditorGUILayout.HelpBox(
"NOTE: if you get \"Requested build target group (N) doesn't exist\" or [CS0618] errors during the setup don't worry: it's ok and allows the setup to work on all possible Unity versions", // "NOTE: if you get \"Requested build target group (N) doesn't exist\" or [CS0618] errors during the setup don't worry: it's ok and allows the setup to work on all possible Unity versions",
MessageType.Info // MessageType.Info
); // );
GUILayout.BeginHorizontal(); GUILayout.BeginHorizontal();
if (GUILayout.Button("Documentation", EditorGUIUtils.btStyle, GUILayout.Width(_HalfBtSize))) Application.OpenURL("http://dotween.demigiant.com/documentation.php"); if (GUILayout.Button("Website", EditorGUIUtils.btBigStyle, GUILayout.Width(_HalfBtSize))) Application.OpenURL("http://dotween.demigiant.com/index.php");
if (GUILayout.Button("Support", EditorGUIUtils.btStyle, GUILayout.Width(_HalfBtSize))) Application.OpenURL("http://dotween.demigiant.com/support.php"); if (GUILayout.Button("Get Started", EditorGUIUtils.btBigStyle, GUILayout.Width(_HalfBtSize))) Application.OpenURL("http://dotween.demigiant.com/getstarted.php");
GUILayout.EndHorizontal(); GUILayout.EndHorizontal();
GUILayout.BeginHorizontal(); GUILayout.BeginHorizontal();
if (GUILayout.Button("Changelog", EditorGUIUtils.btStyle, GUILayout.Width(_HalfBtSize))) Application.OpenURL("http://dotween.demigiant.com/download.php"); if (GUILayout.Button("Documentation", EditorGUIUtils.btBigStyle, GUILayout.Width(_HalfBtSize))) Application.OpenURL("http://dotween.demigiant.com/documentation.php");
if (GUILayout.Button("Check Updates", EditorGUIUtils.btStyle, GUILayout.Width(_HalfBtSize))) Application.OpenURL("http://dotween.demigiant.com/download.php?v=" + DOTween.Version); if (GUILayout.Button("Support", EditorGUIUtils.btBigStyle, GUILayout.Width(_HalfBtSize))) Application.OpenURL("http://dotween.demigiant.com/support.php");
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
if (GUILayout.Button("Changelog", EditorGUIUtils.btBigStyle, GUILayout.Width(_HalfBtSize))) Application.OpenURL("http://dotween.demigiant.com/download.php");
if (GUILayout.Button("Check Updates", EditorGUIUtils.btBigStyle, GUILayout.Width(_HalfBtSize))) Application.OpenURL("http://dotween.demigiant.com/download.php?v=" + DOTween.Version);
GUILayout.EndHorizontal(); GUILayout.EndHorizontal();
GUILayout.Space(14); GUILayout.Space(14);
if (GUILayout.Button(_footerImg, EditorGUIUtils.btImgStyle)) Application.OpenURL("http://www.demigiant.com/"); if (GUILayout.Button(_footerImg, EditorGUIUtils.btImgStyle)) Application.OpenURL("http://www.demigiant.com/");
@ -214,7 +188,7 @@ namespace DG.DOTweenEditor
void DrawPreferencesGUI() void DrawPreferencesGUI()
{ {
GUILayout.Space(40); GUILayout.Space(40);
if (GUILayout.Button("Reset", EditorGUIUtils.btStyle)) { if (GUILayout.Button("Reset", EditorGUIUtils.btBigStyle)) {
// Reset to original defaults // Reset to original defaults
_src.useSafeMode = true; _src.useSafeMode = true;
_src.showUnityEditorReport = false; _src.showUnityEditorReport = false;
@ -279,7 +253,7 @@ namespace DG.DOTweenEditor
_src.defaultAutoKill = EditorGUILayout.Toggle("AutoKill", _src.defaultAutoKill); _src.defaultAutoKill = EditorGUILayout.Toggle("AutoKill", _src.defaultAutoKill);
_src.defaultLoopType = (LoopType)EditorGUILayout.EnumPopup("Loop Type", _src.defaultLoopType); _src.defaultLoopType = (LoopType)EditorGUILayout.EnumPopup("Loop Type", _src.defaultLoopType);
if (GUI.changed) EditorUtility.SetDirty(_src); if (UnityEngine.GUI.changed) EditorUtility.SetDirty(_src);
} }
// =================================================================================== // ===================================================================================

View File

@ -0,0 +1,95 @@
// Author: Daniele Giardini - http://www.demigiant.com
// Created: 2018/07/14 18:56
// License Copyright (c) Daniele Giardini
// This work is subject to the terms at http://dotween.demigiant.com/license.php
using UnityEditor;
using UnityEngine;
namespace DG.DOTweenEditor.UI
{
public static class DOTweenUtilityWindowModules
{
static bool _hasAudioModule;
static bool _hasPhysicsModule;
static bool _hasPhysics2DModule;
static bool _hasSpriteModule;
static bool _hasUIModule;
static bool _hasTextMeshProModule;
static bool _hasTk2DModule;
public static void Refresh()
{
_hasAudioModule = EditorUtils.HasGlobalDefine(DOTweenDefines.GlobalDefine_AudioModule);
_hasPhysicsModule = EditorUtils.HasGlobalDefine(DOTweenDefines.GlobalDefine_PhysicsModule);
_hasPhysics2DModule = EditorUtils.HasGlobalDefine(DOTweenDefines.GlobalDefine_Physics2DModule);
_hasSpriteModule = EditorUtils.HasGlobalDefine(DOTweenDefines.GlobalDefine_SpriteModule);
_hasUIModule = EditorUtils.HasGlobalDefine(DOTweenDefines.GlobalDefine_UIModule);
_hasTextMeshProModule = EditorUtils.HasGlobalDefine(DOTweenDefines.GlobalDefine_TextMeshPro);
_hasTk2DModule = EditorUtils.HasGlobalDefine(DOTweenDefines.GlobalDefine_TK2D);
}
// Returns TRUE if it should be closed
public static bool Draw()
{
GUILayout.Label("Add/Remove Modules", EditorGUIUtils.titleStyle);
GUILayout.BeginVertical(UnityEngine.GUI.skin.box);
GUILayout.Label("Unity", EditorGUIUtils.boldLabelStyle);
_hasAudioModule = EditorGUILayout.Toggle("Audio", _hasAudioModule);
_hasPhysicsModule = EditorGUILayout.Toggle("Physics", _hasPhysicsModule);
_hasPhysics2DModule = EditorGUILayout.Toggle("Physics2D", _hasPhysics2DModule);
_hasSpriteModule = EditorGUILayout.Toggle("Sprites", _hasSpriteModule);
_hasUIModule = EditorGUILayout.Toggle("UI", _hasUIModule);
EditorGUILayout.EndVertical();
if (EditorUtils.hasPro) {
GUILayout.BeginVertical(UnityEngine.GUI.skin.box);
GUILayout.Label("External Assets (Pro)", EditorGUIUtils.boldLabelStyle);
_hasTk2DModule = EditorGUILayout.Toggle("2D Toolkit", _hasTk2DModule);
_hasTextMeshProModule = EditorGUILayout.Toggle("TextMesh Pro", _hasTextMeshProModule);
EditorGUILayout.EndVertical();
}
GUILayout.Space(2);
GUILayout.BeginHorizontal();
if (GUILayout.Button("Apply")) {
Apply();
return true;
}
if (GUILayout.Button("Cancel")) return true;
GUILayout.EndHorizontal();
// EditorGUILayout.HelpBox(
// "NOTE: if you get \"PlayerSettings Validation\" or [CS0618] errors when you press apply don't worry:" +
// " it's ok and it allows the setup to work on all possible Unity versions",
// MessageType.Warning
// );
return false;
}
static void Apply()
{
ModifyDefineIfChanged(_hasAudioModule, DOTweenDefines.GlobalDefine_AudioModule);
ModifyDefineIfChanged(_hasPhysicsModule, DOTweenDefines.GlobalDefine_PhysicsModule);
ModifyDefineIfChanged(_hasPhysics2DModule, DOTweenDefines.GlobalDefine_Physics2DModule);
ModifyDefineIfChanged(_hasSpriteModule, DOTweenDefines.GlobalDefine_SpriteModule);
ModifyDefineIfChanged(_hasUIModule, DOTweenDefines.GlobalDefine_UIModule);
if (EditorUtils.hasPro) {
ModifyDefineIfChanged(_hasTextMeshProModule, DOTweenDefines.GlobalDefine_TextMeshPro);
ModifyDefineIfChanged(_hasTk2DModule, DOTweenDefines.GlobalDefine_TK2D);
}
}
static void ModifyDefineIfChanged(bool wantsToBeSet, string defineId)
{
bool hasDefine = EditorUtils.HasGlobalDefine(defineId);
if (wantsToBeSet != hasDefine) {
if (wantsToBeSet) EditorUtils.AddGlobalDefine(defineId);
else EditorUtils.RemoveGlobalDefine(defineId);
}
}
}
}

View File

@ -6,7 +6,7 @@ using DG.Tweening;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;
namespace DG.DOTweenEditor.Core namespace DG.DOTweenEditor.UI
{ {
public static class EditorGUIUtils public static class EditorGUIUtils
{ {
@ -14,7 +14,8 @@ namespace DG.DOTweenEditor.Core
public static GUIStyle boldLabelStyle, public static GUIStyle boldLabelStyle,
setupLabelStyle, setupLabelStyle,
redLabelStyle, redLabelStyle,
btStyle, btBigStyle,
btSetup,
btImgStyle, btImgStyle,
wrapCenterLabelStyle; wrapCenterLabelStyle;
public static GUIStyle handlelabelStyle, public static GUIStyle handlelabelStyle,
@ -100,16 +101,16 @@ namespace DG.DOTweenEditor.Core
// A button which works as a toggle // A button which works as a toggle
public static bool ToggleButton(bool toggled, GUIContent content, GUIStyle guiStyle = null, params GUILayoutOption[] options) public static bool ToggleButton(bool toggled, GUIContent content, GUIStyle guiStyle = null, params GUILayoutOption[] options)
{ {
Color orColor = GUI.backgroundColor; Color orColor = UnityEngine.GUI.backgroundColor;
GUI.backgroundColor = toggled ? Color.green : Color.white; UnityEngine.GUI.backgroundColor = toggled ? Color.green : Color.white;
bool clicked = guiStyle == null bool clicked = guiStyle == null
? GUILayout.Button(content, options) ? GUILayout.Button(content, options)
: GUILayout.Button(content, guiStyle, options); : GUILayout.Button(content, guiStyle, options);
if (clicked) { if (clicked) {
toggled = !toggled; toggled = !toggled;
GUI.changed = true; UnityEngine.GUI.changed = true;
} }
GUI.backgroundColor = orColor; UnityEngine.GUI.backgroundColor = orColor;
return toggled; return toggled;
} }
@ -119,7 +120,7 @@ namespace DG.DOTweenEditor.Core
_additionalStylesSet = true; _additionalStylesSet = true;
Vector2 footerSizeV = (Vector2)footerSize; Vector2 footerSizeV = (Vector2)footerSize;
btImgStyle = new GUIStyle(GUI.skin.button); btImgStyle = new GUIStyle(UnityEngine.GUI.skin.button);
btImgStyle.normal.background = null; btImgStyle.normal.background = null;
btImgStyle.imagePosition = ImagePosition.ImageOnly; btImgStyle.imagePosition = ImagePosition.ImageOnly;
btImgStyle.padding = new RectOffset(0, 0, 0, 0); btImgStyle.padding = new RectOffset(0, 0, 0, 0);
@ -130,28 +131,33 @@ namespace DG.DOTweenEditor.Core
if (!_stylesSet) { if (!_stylesSet) {
_stylesSet = true; _stylesSet = true;
boldLabelStyle = new GUIStyle(GUI.skin.label); boldLabelStyle = new GUIStyle(UnityEngine.GUI.skin.label);
boldLabelStyle.fontStyle = FontStyle.Bold; boldLabelStyle.fontStyle = FontStyle.Bold;
redLabelStyle = new GUIStyle(GUI.skin.label); redLabelStyle = new GUIStyle(UnityEngine.GUI.skin.label);
redLabelStyle.normal.textColor = Color.red; redLabelStyle.normal.textColor = Color.red;
setupLabelStyle = new GUIStyle(boldLabelStyle); setupLabelStyle = new GUIStyle(boldLabelStyle);
setupLabelStyle.alignment = TextAnchor.MiddleCenter; setupLabelStyle.alignment = TextAnchor.MiddleCenter;
wrapCenterLabelStyle = new GUIStyle(GUI.skin.label); wrapCenterLabelStyle = new GUIStyle(UnityEngine.GUI.skin.label);
wrapCenterLabelStyle.wordWrap = true; wrapCenterLabelStyle.wordWrap = true;
wrapCenterLabelStyle.alignment = TextAnchor.MiddleCenter; wrapCenterLabelStyle.alignment = TextAnchor.MiddleCenter;
btStyle = new GUIStyle(GUI.skin.button); btBigStyle = new GUIStyle(UnityEngine.GUI.skin.button);
btStyle.padding = new RectOffset(0, 0, 10, 10); btBigStyle.padding = new RectOffset(0, 0, 10, 10);
btSetup = new GUIStyle(btBigStyle);
btSetup.padding = new RectOffset(36, 36, 6, 6);
btSetup.wordWrap = true;
btSetup.richText = true;
// //
titleStyle = new GUIStyle(GUI.skin.label) { titleStyle = new GUIStyle(UnityEngine.GUI.skin.label) {
fontSize = 12, fontSize = 12,
fontStyle = FontStyle.Bold fontStyle = FontStyle.Bold
}; };
handlelabelStyle = new GUIStyle(GUI.skin.label) { handlelabelStyle = new GUIStyle(UnityEngine.GUI.skin.label) {
normal = { textColor = Color.white }, normal = { textColor = Color.white },
alignment = TextAnchor.MiddleLeft alignment = TextAnchor.MiddleLeft
}; };
@ -160,20 +166,20 @@ namespace DG.DOTweenEditor.Core
fontStyle = FontStyle.Bold fontStyle = FontStyle.Bold
}; };
wordWrapLabelStyle = new GUIStyle(GUI.skin.label); wordWrapLabelStyle = new GUIStyle(UnityEngine.GUI.skin.label);
wordWrapLabelStyle.wordWrap = true; wordWrapLabelStyle.wordWrap = true;
wordWrapItalicLabelStyle = new GUIStyle(wordWrapLabelStyle); wordWrapItalicLabelStyle = new GUIStyle(wordWrapLabelStyle);
wordWrapItalicLabelStyle.fontStyle = FontStyle.Italic; wordWrapItalicLabelStyle.fontStyle = FontStyle.Italic;
logoIconStyle = new GUIStyle(GUI.skin.box); logoIconStyle = new GUIStyle(UnityEngine.GUI.skin.box);
logoIconStyle.active.background = logoIconStyle.normal.background = null; logoIconStyle.active.background = logoIconStyle.normal.background = null;
logoIconStyle.margin = new RectOffset(0, 0, 0, 0); logoIconStyle.margin = new RectOffset(0, 0, 0, 0);
logoIconStyle.padding = new RectOffset(0, 0, 0, 0); logoIconStyle.padding = new RectOffset(0, 0, 0, 0);
// //
sideBtStyle = new GUIStyle(GUI.skin.button); sideBtStyle = new GUIStyle(UnityEngine.GUI.skin.button);
sideBtStyle.margin.top = 1; sideBtStyle.margin.top = 1;
sideBtStyle.padding = new RectOffset(0, 0, 2, 2); sideBtStyle.padding = new RectOffset(0, 0, 2, 2);
@ -181,14 +187,14 @@ namespace DG.DOTweenEditor.Core
sideLogoIconBoldLabelStyle.alignment = TextAnchor.MiddleLeft; sideLogoIconBoldLabelStyle.alignment = TextAnchor.MiddleLeft;
sideLogoIconBoldLabelStyle.padding.top = 2; sideLogoIconBoldLabelStyle.padding.top = 2;
wordWrapTextArea = new GUIStyle(GUI.skin.textArea); wordWrapTextArea = new GUIStyle(UnityEngine.GUI.skin.textArea);
wordWrapTextArea.wordWrap = true; wordWrapTextArea.wordWrap = true;
popupButton = new GUIStyle(EditorStyles.popup); popupButton = new GUIStyle(EditorStyles.popup);
popupButton.fixedHeight = 18; popupButton.fixedHeight = 18;
popupButton.margin.top += 1; popupButton.margin.top += 1;
btIconStyle = new GUIStyle(GUI.skin.button); btIconStyle = new GUIStyle(UnityEngine.GUI.skin.button);
btIconStyle.padding.left -= 2; btIconStyle.padding.left -= 2;
btIconStyle.fixedWidth = 24; btIconStyle.fixedWidth = 24;
btIconStyle.stretchWidth = false; btIconStyle.stretchWidth = false;

View File

@ -0,0 +1,49 @@
// Author: Daniele Giardini - http://www.demigiant.com
// Created: 2018/07/16 18:41
// License Copyright (c) Daniele Giardini
// This work is subject to the terms at http://dotween.demigiant.com/license.php
using System;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEngine;
using DateTime = System.DateTime;
namespace DG.DOTweenUpgradeManager
{
/// <summary>
/// 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
/// </summary>
[InitializeOnLoad]
static class Autorun
{
static readonly string _Id = "DOTweenUpgradeManager";
static Autorun()
{
_Id = Application.dataPath + _Id;
bool refresh;
DateTime now = DateTime.UtcNow;
DateTime lastTime;
if (!EditorPrefs.HasKey(_Id) || !DateTime.TryParse(EditorPrefs.GetString(_Id), out lastTime)) {
refresh = true;
} else {
refresh = (now - lastTime).TotalSeconds > 60;
}
if (refresh) {
EditorPrefs.SetString(_Id, now.ToString());
EditorUtility.DisplayDialog("DOTween",
"DOTWEEN SETUP REQUIRED: new version imported." +
"\n\nSelect \"Setup DOTween...\" in DOTween's Utility Panel to set it up and add/remove Modules." +
"\n\n::::: IMPORTANT :::::" +
"\nIf you're upgrading from a DOTween version older than 1.2.000 you will see lots of errors." +
"\n1) Close and reopen the project (if you haven't already done so)" +
"\n2) Open DOTween's Utility Panel and run the Setup to activate required Modules",
"Ok"
);
}
}
}
}

View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{6BC7290B-999D-4688-959C-868306C1F52B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DG.DOTweenUpgradeManager</RootNamespace>
<AssemblyName>DOTweenUpgradeManager</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>Unity Subset v3.5</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\bin\Editor\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\bin\Editor\DOTweenUpgradeManager.XML</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\bin\Editor\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\bin\Editor\DOTweenUpgradeManager.XML</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="UnityEditor">
<HintPath>C:\Program Files (x86)\Unity 46\Editor\Data\Managed\UnityEditor.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine">
<HintPath>C:\Program Files (x86)\Unity 46\Editor\Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Autorun.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>call $(SolutionDir)PostBuild_DOTween.bat $(SolutionDir) $(TargetDir) $(TargetFileName) $(TargetName) DOTween bin Editor</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -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")]

View File

@ -0,0 +1,121 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0B529A90-0B97-4840-BEB6-4A6700B46655}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DG.Tweening</RootNamespace>
<AssemblyName>DOTween_LooseScripts</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>Unity Subset v3.5</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>
</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\bin\</OutputPath>
<DefineConstants>TRACE;DOTAUDIO;DOTPHYSICS;DOTPHYSICS2D;DOTSPRITE;DOTUI;UNITY_4_3;UNITY_4_6;UNITY_5;UNITY_2017_0_OR_NEWER</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>
</DocumentationFile>
<NoWarn>1573</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="DemiEditor">
<HintPath>..\..\..\bin.Global_no_meta\DemiLib\Core\Editor\DemiEditor.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="DemiLib">
<HintPath>..\..\..\bin.Global_no_meta\DemiLib\Core\DemiLib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="UnityEditor">
<HintPath>C:\Program Files\Unity\Editor\Data\Managed\UnityEditor.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine">
<HintPath>C:\Program Files\Unity\Editor\Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>C:\Program Files\Unity\Editor\Data\UnityExtensions\Unity\GUISystem\UnityEngine.UI.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="..\bin\*.cs">
<Link>bin\%(FileName)</Link>
</Compile>
<Compile Include="..\bin\*.txt">
<Link>bin\%(FileName)</Link>
</Compile>
<Compile Include="..\bin\Modules\*.cs">
<Link>bin\Modules\%(FileName)</Link>
</Compile>
<Compile Include="..\bin\Modules\*.txt">
<Link>bin\Modules\%(FileName)</Link>
</Compile>
<Compile Include="..\bin_pro\*.cs">
<Link>bin_pro\%(FileName)</Link>
</Compile>
<Compile Include="..\bin_pro\*.txt">
<Link>bin_pro\%(FileName)</Link>
</Compile>
<Compile Include="..\bin_pro\Editor\*.cs">
<Link>bin_pro\Editor\%(FileName)</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DOTweenEditor\DOTweenEditor.csproj">
<Project>{421acc19-8922-4e98-8921-b52240ce172a}</Project>
<Name>DOTweenEditor</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\DOTweenProEditor\DOTweenProEditor.csproj">
<Project>{279545ae-d268-42f0-a4c6-aa5ba15fb9be}</Project>
<Name>DOTweenProEditor</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\DOTweenPro\DOTweenPro.csproj">
<Project>{20d2e542-d14f-4678-9c38-f3c0ecf6a2f6}</Project>
<Name>DOTweenPro</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\DOTween\DOTween.csproj">
<Project>{de17c145-3e8d-45d6-bbb6-d06bd7d80a55}</Project>
<Name>DOTween</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -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")]

View File

@ -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 :

View File

@ -179,6 +179,26 @@
Public only so custom shortcuts can access some of these methods Public only so custom shortcuts can access some of these methods
</summary> </summary>
</member> </member>
<member name="M:DG.Tweening.Core.Extensions.SetSpecialStartupMode``1(``0,DG.Tweening.Core.Enums.SpecialStartupMode)">
<summary>
INTERNAL: used by DO shortcuts and Modules to set special startup mode
</summary>
</member>
<member name="M:DG.Tweening.Core.Extensions.Blendable``3(DG.Tweening.Core.TweenerCore{``0,``1,``2})">
<summary>
INTERNAL: used by DO shortcuts and Modules to set the tween as blendable
</summary>
</member>
<member name="M:DG.Tweening.Core.Extensions.NoFrom``3(DG.Tweening.Core.TweenerCore{``0,``1,``2})">
<summary>
INTERNAL: used by DO shortcuts and Modules to prevent a tween from using a From setup even if passed
</summary>
</member>
<member name="T:DG.Tweening.Core.DOTweenExternalCommand">
<summary>
Used to dispatch commands that need to be captured externally, usually by Modules
</summary>
</member>
<member name="M:DG.Tweening.Core.Utils.Vector3FromAngle(System.Single,System.Single)"> <member name="M:DG.Tweening.Core.Utils.Vector3FromAngle(System.Single,System.Single)">
<summary> <summary>
Returns a Vector3 with z = 0 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. because the latter fails (in some cases) when assigning a Vector3 to a transform.position and then checking it.
</summary> </summary>
</member> </member>
<member name="M:DG.Tweening.Core.Utils.GetLooseScriptType(System.String)">
<summary>
Looks for the type withing all possible project assembly names
</summary>
</member>
<member name="T:DG.Tweening.Color2"> <member name="T:DG.Tweening.Color2">
<summary> <summary>
Struct that stores two colors (used for LineRenderer tweens) 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 Methods that extend known Unity objects and allow to directly create and control tweens from their instances
</summary> </summary>
</member> </member>
<member name="M:DG.Tweening.ShortcutExtensions.DOFade(UnityEngine.AudioSource,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach (0 to 1)</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOPitch(UnityEngine.AudioSource,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOAspect(UnityEngine.Camera,System.Single,System.Single)"> <member name="M:DG.Tweening.ShortcutExtensions.DOAspect(UnityEngine.Camera,System.Single,System.Single)">
<summary>Tweens a Camera's <code>aspect</code> to the given value. <summary>Tweens a Camera's <code>aspect</code> to the given value.
Also stores the camera as the tween's target so it can be used for filtered operations</summary> Also stores the camera as the tween's target so it can be used for filtered operations</summary>
@ -1418,81 +1433,6 @@
<param name="property">The name of the material property to tween</param> <param name="property">The name of the material property to tween</param>
<param name="duration">The duration of the tween</param> <param name="duration">The duration of the tween</param>
</member> </member>
<member name="M:DG.Tweening.ShortcutExtensions.DOMove(UnityEngine.Rigidbody,UnityEngine.Vector3,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOMoveX(UnityEngine.Rigidbody,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOMoveY(UnityEngine.Rigidbody,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOMoveZ(UnityEngine.Rigidbody,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DORotate(UnityEngine.Rigidbody,UnityEngine.Vector3,System.Single,DG.Tweening.RotateMode)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="mode">Rotation mode</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOLookAt(UnityEngine.Rigidbody,UnityEngine.Vector3,System.Single,DG.Tweening.AxisConstraint,System.Nullable{UnityEngine.Vector3})">
<summary>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</summary>
<param name="towards">The position to look at</param><param name="duration">The duration of the tween</param>
<param name="axisConstraint">Eventual axis constraint for the rotation</param>
<param name="up">The vector that defines in which direction up is (default: Vector3.up)</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOJump(UnityEngine.Rigidbody,UnityEngine.Vector3,System.Single,System.Int32,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param>
<param name="jumpPower">Power of the jump (the max height of the jump is represented by this plus the final Y offset)</param>
<param name="numJumps">Total number of jumps</param>
<param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOPath(UnityEngine.Rigidbody,UnityEngine.Vector3[],System.Single,DG.Tweening.PathType,DG.Tweening.PathMode,System.Int32,System.Nullable{UnityEngine.Color})">
<summary>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.
<para>NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.</para>
<para>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.</para></summary>
<param name="path">The waypoints to go through</param>
<param name="duration">The duration of the tween</param>
<param name="pathType">The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)</param>
<param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
<param name="resolution">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</param>
<param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOLocalPath(UnityEngine.Rigidbody,UnityEngine.Vector3[],System.Single,DG.Tweening.PathType,DG.Tweening.PathMode,System.Int32,System.Nullable{UnityEngine.Color})">
<summary>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
<para>NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.</para>
<para>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.</para></summary>
<param name="path">The waypoint to go through</param>
<param name="duration">The duration of the tween</param>
<param name="pathType">The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)</param>
<param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
<param name="resolution">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</param>
<param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOResize(UnityEngine.TrailRenderer,System.Single,System.Single,System.Single)"> <member name="M:DG.Tweening.ShortcutExtensions.DOResize(UnityEngine.TrailRenderer,System.Single,System.Single,System.Single)">
<summary>Tweens a TrailRenderer's startWidth/endWidth to the given value. <summary>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</summary> Also stores the TrailRenderer as the tween's target so it can be used for filtered operations</summary>
@ -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</param> Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints</param>
<param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param> <param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
</member> </member>
<member name="M:DG.Tweening.ShortcutExtensions.DOPath(UnityEngine.Transform,DG.Tweening.Plugins.Core.PathCore.Path,System.Single,DG.Tweening.PathMode)">
<summary>IMPORTANT: Unless you really know what you're doing, you should use the overload that accepts a Vector3 array instead.<para/>
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</summary>
<param name="path">The path to use</param>
<param name="duration">The duration of the tween</param>
<param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOLocalPath(UnityEngine.Transform,DG.Tweening.Plugins.Core.PathCore.Path,System.Single,DG.Tweening.PathMode)">
<summary>IMPORTANT: Unless you really know what you're doing, you should use the overload that accepts a Vector3 array instead.<para/>
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</summary>
<param name="path">The path to use</param>
<param name="duration">The duration of the tween</param>
<param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions.DOTimeScale(DG.Tweening.Tween,System.Single,System.Single)"> <member name="M:DG.Tweening.ShortcutExtensions.DOTimeScale(DG.Tweening.Tween,System.Single,System.Single)">
<summary>Tweens a Tween's timeScale to the given value. <summary>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</summary> Also stores the Tween as the tween's target so it can be used for filtered operations</summary>
@ -2523,9 +2479,21 @@
<member name="F:DG.Tweening.Tween.onWaypointChange"> <member name="F:DG.Tweening.Tween.onWaypointChange">
<summary>Called when a path tween's current waypoint changes</summary> <summary>Called when a path tween's current waypoint changes</summary>
</member> </member>
<member name="P:DG.Tweening.Tween.isRelative">
<summary>Tweeners-only (ignored by Sequences), returns TRUE if the tween was set as relative</summary>
</member>
<member name="P:DG.Tweening.Tween.active">
<summary>FALSE when tween is (or should be) despawned - set only by TweenManager</summary>
</member>
<member name="P:DG.Tweening.Tween.fullPosition"> <member name="P:DG.Tweening.Tween.fullPosition">
<summary>Gets and sets the time position (loops included, delays excluded) of the tween</summary> <summary>Gets and sets the time position (loops included, delays excluded) of the tween</summary>
</member> </member>
<member name="P:DG.Tweening.Tween.playedOnce">
<summary>TRUE after the tween was set in a play state at least once, AFTER any delay is elapsed</summary>
</member>
<member name="P:DG.Tweening.Tween.position">
<summary>Time position within a single loop cycle</summary>
</member>
<member name="T:DG.Tweening.Tweener"> <member name="T:DG.Tweening.Tweener">
<summary> <summary>
Animates a single value Animates a single value

Binary file not shown.

Binary file not shown.

View File

@ -1,85 +0,0 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>DOTween43</name>
</assembly>
<members>
<member name="T:DG.Tweening.ShortcutExtensions43">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOGradientColor(UnityEngine.Material,UnityEngine.Gradient,System.Single)">
<summary>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</summary>
<param name="gradient">The gradient to use</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOGradientColor(UnityEngine.Material,UnityEngine.Gradient,System.String,System.Single)">
<summary>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</summary>
<param name="gradient">The gradient to use</param>
<param name="property">The name of the material property to tween (like _Tint or _SpecColor)</param>
<param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOColor(UnityEngine.SpriteRenderer,UnityEngine.Color,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOFade(UnityEngine.SpriteRenderer,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOGradientColor(UnityEngine.SpriteRenderer,UnityEngine.Gradient,System.Single)">
<summary>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</summary>
<param name="gradient">The gradient to use</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOMove(UnityEngine.Rigidbody2D,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOMoveX(UnityEngine.Rigidbody2D,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOMoveY(UnityEngine.Rigidbody2D,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DORotate(UnityEngine.Rigidbody2D,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOJump(UnityEngine.Rigidbody2D,UnityEngine.Vector2,System.Single,System.Int32,System.Single,System.Boolean)">
<summary>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.
<para>IMPORTANT: a rigidbody2D can't be animated in a jump arc using MovePosition, so the tween will directly set the position</para></summary>
<param name="endValue">The end value to reach</param>
<param name="jumpPower">Power of the jump (the max height of the jump is represented by this plus the final Y offset)</param>
<param name="numJumps">Total number of jumps</param>
<param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions43.DOBlendableColor(UnityEngine.SpriteRenderer,UnityEngine.Color,System.Single)">
<summary>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</summary>
<param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
</member>
</members>
</doc>

Binary file not shown.

View File

@ -1,279 +0,0 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>DOTween46</name>
</assembly>
<members>
<member name="T:DG.Tweening.DOTweenUtils46">
<summary>
Various utils that require Unity 4.6 or later
</summary>
</member>
<member name="M:DG.Tweening.DOTweenUtils46.SwitchToRectTransform(UnityEngine.RectTransform,UnityEngine.RectTransform)">
<summary>
Converts the anchoredPosition of the first RectTransform to the second RectTransform,
taking into consideration offset, anchors and pivot, and returns the new anchoredPosition
</summary>
</member>
<member name="T:DG.Tweening.ShortcutExtensions46">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOFade(UnityEngine.CanvasGroup,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOColor(UnityEngine.UI.Graphic,UnityEngine.Color,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOFade(UnityEngine.UI.Graphic,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOColor(UnityEngine.UI.Image,UnityEngine.Color,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOFade(UnityEngine.UI.Image,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOFillAmount(UnityEngine.UI.Image,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach (0 to 1)</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOGradientColor(UnityEngine.UI.Image,UnityEngine.Gradient,System.Single)">
<summary>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</summary>
<param name="gradient">The gradient to use</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOFlexibleSize(UnityEngine.UI.LayoutElement,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOMinSize(UnityEngine.UI.LayoutElement,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOPreferredSize(UnityEngine.UI.LayoutElement,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOColor(UnityEngine.UI.Outline,UnityEngine.Color,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOFade(UnityEngine.UI.Outline,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOScale(UnityEngine.UI.Outline,UnityEngine.Vector2,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOAnchorPos(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOAnchorPosX(UnityEngine.RectTransform,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOAnchorPosY(UnityEngine.RectTransform,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOAnchorPos3D(UnityEngine.RectTransform,UnityEngine.Vector3,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOAnchorPos3DX(UnityEngine.RectTransform,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOAnchorPos3DY(UnityEngine.RectTransform,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOAnchorPos3DZ(UnityEngine.RectTransform,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOAnchorMax(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOAnchorMin(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOPivot(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOPivotX(UnityEngine.RectTransform,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOPivotY(UnityEngine.RectTransform,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOSizeDelta(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOPunchAnchorPos(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Int32,System.Single,System.Boolean)">
<summary>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</summary>
<param name="punch">The direction and strength of the punch (added to the RectTransform's current position)</param>
<param name="duration">The duration of the tween</param>
<param name="vibrato">Indicates how much will the punch vibrate</param>
<param name="elasticity">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</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOShakeAnchorPos(UnityEngine.RectTransform,System.Single,System.Single,System.Int32,System.Single,System.Boolean,System.Boolean)">
<summary>Shakes a RectTransform's anchoredPosition with the given values.
Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
<param name="duration">The duration of the tween</param>
<param name="strength">The shake strength</param>
<param name="vibrato">Indicates how much will the shake vibrate</param>
<param name="randomness">Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
Setting it to 0 will shake along a single direction.</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
<param name="fadeOut">If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOShakeAnchorPos(UnityEngine.RectTransform,System.Single,UnityEngine.Vector2,System.Int32,System.Single,System.Boolean,System.Boolean)">
<summary>Shakes a RectTransform's anchoredPosition with the given values.
Also stores the RectTransform as the tween's target so it can be used for filtered operations</summary>
<param name="duration">The duration of the tween</param>
<param name="strength">The shake strength on each axis</param>
<param name="vibrato">Indicates how much will the shake vibrate</param>
<param name="randomness">Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware).
Setting it to 0 will shake along a single direction.</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
<param name="fadeOut">If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOJumpAnchorPos(UnityEngine.RectTransform,UnityEngine.Vector2,System.Single,System.Int32,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param>
<param name="jumpPower">Power of the jump (the max height of the jump is represented by this plus the final Y offset)</param>
<param name="numJumps">Total number of jumps</param>
<param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DONormalizedPos(UnityEngine.UI.ScrollRect,UnityEngine.Vector2,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOHorizontalNormalizedPos(UnityEngine.UI.ScrollRect,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOVerticalNormalizedPos(UnityEngine.UI.ScrollRect,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOValue(UnityEngine.UI.Slider,System.Single,System.Single,System.Boolean)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
<param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOColor(UnityEngine.UI.Text,UnityEngine.Color,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOFade(UnityEngine.UI.Text,System.Single,System.Single)">
<summary>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</summary>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOText(UnityEngine.UI.Text,System.String,System.Single,System.Boolean,DG.Tweening.ScrambleMode,System.String)">
<summary>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</summary>
<param name="endValue">The end string to tween to</param><param name="duration">The duration of the tween</param>
<param name="richTextEnabled">If TRUE (default), rich text will be interpreted correctly while animated,
otherwise all tags will be considered as normal text</param>
<param name="scrambleMode">The type of scramble mode to use, if any</param>
<param name="scrambleChars">A string containing the characters to use for scrambling.
Use as many characters as possible (minimum 10) because DOTween uses a fast scramble mode which gives better results with more characters.
Leave it to NULL (default) to use default ones</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOBlendableColor(UnityEngine.UI.Graphic,UnityEngine.Color,System.Single)">
<summary>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</summary>
<param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOBlendableColor(UnityEngine.UI.Image,UnityEngine.Color,System.Single)">
<summary>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</summary>
<param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions46.DOBlendableColor(UnityEngine.UI.Text,UnityEngine.Color,System.Single)">
<summary>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</summary>
<param name="endValue">The value to tween to</param><param name="duration">The duration of the tween</param>
</member>
</members>
</doc>

Binary file not shown.

View File

@ -1,163 +0,0 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>DOTween50</name>
</assembly>
<members>
<member name="T:DG.Tweening.ShortcutExtensions50">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOSetFloat(UnityEngine.Audio.AudioMixer,System.String,System.Single,System.Single)">
<summary>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.</summary>
<param name="floatName">Name given to the exposed float to set</param>
<param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOComplete(UnityEngine.Audio.AudioMixer,System.Boolean)">
<summary>
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)
</summary>
<param name="withCallbacks">For Sequences only: if TRUE also internal Sequence callbacks will be fired,
otherwise they will be ignored</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOKill(UnityEngine.Audio.AudioMixer,System.Boolean)">
<summary>
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.
</summary>
<param name="complete">If TRUE completes the tween before killing it</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOFlip(UnityEngine.Audio.AudioMixer)">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOGoto(UnityEngine.Audio.AudioMixer,System.Single,System.Boolean)">
<summary>
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.
</summary>
<param name="to">Time position to reach
(if higher than the whole tween duration the tween will simply reach its end)</param>
<param name="andPlay">If TRUE will play the tween after reaching the given position, otherwise it will pause it</param>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOPause(UnityEngine.Audio.AudioMixer)">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOPlay(UnityEngine.Audio.AudioMixer)">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOPlayBackwards(UnityEngine.Audio.AudioMixer)">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOPlayForward(UnityEngine.Audio.AudioMixer)">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DORestart(UnityEngine.Audio.AudioMixer)">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DORewind(UnityEngine.Audio.AudioMixer)">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOSmoothRewind(UnityEngine.Audio.AudioMixer)">
<summary>
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.
</summary>
</member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOTogglePause(UnityEngine.Audio.AudioMixer)">
<summary>
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.
</summary>
</member>
<member name="T:DG.Tweening.TweenExtensions53">
<summary>
Methods that extend Tween objects and allow to control or get data from them.
These require at least Unity 5.3
</summary>
</member>
<member name="M:DG.Tweening.TweenExtensions53.WaitForCompletion(DG.Tweening.Tween,System.Boolean)">
<summary>
Returns a <see cref="T:UnityEngine.CustomYieldInstruction"/> that waits until the tween is killed or complete.
It can be used inside a coroutine as a yield.
<para>Example usage:</para><code>yield return myTween.WaitForCompletion(true);</code>
</summary>
</member>
<member name="M:DG.Tweening.TweenExtensions53.WaitForRewind(DG.Tweening.Tween,System.Boolean)">
<summary>
Returns a <see cref="T:UnityEngine.CustomYieldInstruction"/> that waits until the tween is killed or rewinded.
It can be used inside a coroutine as a yield.
<para>Example usage:</para><code>yield return myTween.WaitForRewind();</code>
</summary>
</member>
<member name="M:DG.Tweening.TweenExtensions53.WaitForKill(DG.Tweening.Tween,System.Boolean)">
<summary>
Returns a <see cref="T:UnityEngine.CustomYieldInstruction"/> that waits until the tween is killed.
It can be used inside a coroutine as a yield.
<para>Example usage:</para><code>yield return myTween.WaitForKill();</code>
</summary>
</member>
<member name="M:DG.Tweening.TweenExtensions53.WaitForElapsedLoops(DG.Tweening.Tween,System.Int32,System.Boolean)">
<summary>
Returns a <see cref="T:UnityEngine.CustomYieldInstruction"/> 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.
<para>Example usage:</para><code>yield return myTween.WaitForElapsedLoops(2);</code>
</summary>
<param name="elapsedLoops">Elapsed loops to wait for</param>
</member>
<member name="M:DG.Tweening.TweenExtensions53.WaitForPosition(DG.Tweening.Tween,System.Single,System.Boolean)">
<summary>
Returns a <see cref="T:UnityEngine.CustomYieldInstruction"/> 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.
<para>Example usage:</para><code>yield return myTween.WaitForPosition(2.5f);</code>
</summary>
<param name="position">Position (loops included, delays excluded) to wait for</param>
</member>
<member name="M:DG.Tweening.TweenExtensions53.WaitForStart(DG.Tweening.Tween,System.Boolean)">
<summary>
Returns a <see cref="T:UnityEngine.CustomYieldInstruction"/> 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.
<para>Example usage:</para><code>yield return myTween.WaitForStart();</code>
</summary>
</member>
</members>
</doc>

View File

@ -4,37 +4,37 @@
<name>DOTweenEditor</name> <name>DOTweenEditor</name>
</assembly> </assembly>
<members> <members>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.SetEditorTexture(UnityEngine.Texture2D,UnityEngine.FilterMode,System.Int32)"> <member name="M:DG.DOTweenEditor.EditorUtils.SetEditorTexture(UnityEngine.Texture2D,UnityEngine.FilterMode,System.Int32)">
<summary> <summary>
Checks that the given editor texture use the correct import settings, Checks that the given editor texture use the correct import settings,
and applies them if they're incorrect. and applies them if they're incorrect.
</summary> </summary>
</member> </member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.DOTweenSetupRequired"> <member name="M:DG.DOTweenEditor.EditorUtils.DOTweenSetupRequired">
<summary> <summary>
Returns TRUE if addons setup is required. Returns TRUE if setup is required
</summary> </summary>
</member> </member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.AssetExists(System.String)"> <member name="M:DG.DOTweenEditor.EditorUtils.AssetExists(System.String)">
<summary> <summary>
Returns TRUE if the file/directory at the given path exists. Returns TRUE if the file/directory at the given path exists.
</summary> </summary>
<param name="adbPath">Path, relative to Unity's project folder</param> <param name="adbPath">Path, relative to Unity's project folder</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.ADBPathToFullPath(System.String)"> <member name="M:DG.DOTweenEditor.EditorUtils.ADBPathToFullPath(System.String)">
<summary> <summary>
Converts the given project-relative path to a full path, Converts the given project-relative path to a full path,
with backward (\) slashes). with backward (\) slashes).
</summary> </summary>
</member> </member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.FullPathToADBPath(System.String)"> <member name="M:DG.DOTweenEditor.EditorUtils.FullPathToADBPath(System.String)">
<summary> <summary>
Converts the given full path to a path usable with AssetDatabase methods 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). (relative to Unity's project folder, and with the correct Unity forward (/) slashes).
</summary> </summary>
</member> </member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.ConnectToSourceAsset``1(System.String,System.Boolean)"> <member name="M:DG.DOTweenEditor.EditorUtils.ConnectToSourceAsset``1(System.String,System.Boolean)">
<summary> <summary>
Connects to a <see cref="T:UnityEngine.ScriptableObject"/> asset. Connects to a <see cref="T:UnityEngine.ScriptableObject"/> asset.
If the asset already exists at the given path, loads it and returns it. If the asset already exists at the given path, loads it and returns it.
@ -45,21 +45,33 @@
<param name="adbFilePath">File path (relative to Unity's project folder)</param> <param name="adbFilePath">File path (relative to Unity's project folder)</param>
<param name="createIfMissing">If TRUE and the requested asset doesn't exist, forces its creation</param> <param name="createIfMissing">If TRUE and the requested asset doesn't exist, forces its creation</param>
</member> </member>
<member name="M:DG.DOTweenEditor.Core.EditorUtils.GetAssemblyFilePath(System.Reflection.Assembly)"> <member name="M:DG.DOTweenEditor.EditorUtils.GetAssemblyFilePath(System.Reflection.Assembly)">
<summary> <summary>
Full path for the given loaded assembly, assembly file included Full path for the given loaded assembly, assembly file included
</summary> </summary>
</member> </member>
<member name="T:DG.DOTweenEditor.DOTweenSetupMenuItem"> <member name="M:DG.DOTweenEditor.EditorUtils.AddGlobalDefine(System.String)">
<summary>
Adds the given global define if it's not already present
</summary>
</member>
<member name="M:DG.DOTweenEditor.EditorUtils.RemoveGlobalDefine(System.String)">
<summary>
Removes the given global define if it's present
</summary>
</member>
<member name="M:DG.DOTweenEditor.EditorUtils.HasGlobalDefine(System.String,System.Nullable{UnityEditor.BuildTargetGroup})">
<summary>
Returns TRUE if the given global define is present in all the <see cref="T:UnityEditor.BuildTargetGroup"/>
or only in the given <see cref="T:UnityEditor.BuildTargetGroup"/>, depending on passed parameters.<para/>
</summary>
<param name="id"></param>
<param name="buildTargetGroup"><see cref="T:UnityEditor.BuildTargetGroup"/>to use. Leave NULL to check in all of them.</param>
</member>
<member name="T:DG.DOTweenEditor.DOTweenDefines">
<summary> <summary>
Not used as menu item anymore, but as a utiity function Not used as menu item anymore, but as a utiity function
</summary> </summary>
</member> </member>
<member name="M:DG.DOTweenEditor.DOTweenSetupMenuItem.Setup(System.Boolean)">
<summary>
Setups DOTween
</summary>
<param name="partiallySilent">If TRUE, no warning window appears in case there is no need for setup</param>
</member>
</members> </members>
</doc> </doc>

View File

@ -0,0 +1,14 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>DOTweenUpgradeManager</name>
</assembly>
<members>
<member name="T:DG.DOTweenUpgradeManager.Autorun">
<summary>
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
</summary>
</member>
</members>
</doc>

Binary file not shown.

View File

@ -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
/// <summary>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</summary>
/// <param name="endValue">The end value to reach (0 to 1)</param><param name="duration">The duration of the tween</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
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)
/// <summary>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.</summary>
/// <param name="floatName">Name given to the exposed float to set</param>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
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
/// <summary>
/// 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)
/// </summary>
/// <param name="withCallbacks">For Sequences only: if TRUE also internal Sequence callbacks will be fired,
/// otherwise they will be ignored</param>
public static int DOComplete(this AudioMixer target, bool withCallbacks = false)
{
return DOTween.Complete(target, withCallbacks);
}
/// <summary>
/// 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.
/// </summary>
/// <param name="complete">If TRUE completes the tween before killing it</param>
public static int DOKill(this AudioMixer target, bool complete = false)
{
return DOTween.Kill(target, complete);
}
/// <summary>
/// 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.
/// </summary>
public static int DOFlip(this AudioMixer target)
{
return DOTween.Flip(target);
}
/// <summary>
/// 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.
/// </summary>
/// <param name="to">Time position to reach
/// (if higher than the whole tween duration the tween will simply reach its end)</param>
/// <param name="andPlay">If TRUE will play the tween after reaching the given position, otherwise it will pause it</param>
public static int DOGoto(this AudioMixer target, float to, bool andPlay = false)
{
return DOTween.Goto(target, to, andPlay);
}
/// <summary>
/// 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.
/// </summary>
public static int DOPause(this AudioMixer target)
{
return DOTween.Pause(target);
}
/// <summary>
/// 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.
/// </summary>
public static int DOPlay(this AudioMixer target)
{
return DOTween.Play(target);
}
/// <summary>
/// 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.
/// </summary>
public static int DOPlayBackwards(this AudioMixer target)
{
return DOTween.PlayBackwards(target);
}
/// <summary>
/// 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.
/// </summary>
public static int DOPlayForward(this AudioMixer target)
{
return DOTween.PlayForward(target);
}
/// <summary>
/// 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.
/// </summary>
public static int DORestart(this AudioMixer target)
{
return DOTween.Restart(target);
}
/// <summary>
/// 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.
/// </summary>
public static int DORewind(this AudioMixer target)
{
return DOTween.Rewind(target);
}
/// <summary>
/// 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.
/// </summary>
public static int DOSmoothRewind(this AudioMixer target)
{
return DOTween.SmoothRewind(target);
}
/// <summary>
/// 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.
/// </summary>
public static int DOTogglePause(this AudioMixer target)
{
return DOTween.TogglePause(target);
}
#endregion
#endregion
#endif
#endregion
}
}
#endif

View File

@ -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
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="mode">Rotation mode</param>
public static Tweener DORotate(this Rigidbody target, Vector3 endValue, float duration, RotateMode mode = RotateMode.Fast)
{
TweenerCore<Quaternion, Vector3, QuaternionOptions> t = DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration);
t.SetTarget(target);
t.plugOptions.rotateMode = mode;
return t;
}
/// <summary>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</summary>
/// <param name="towards">The position to look at</param><param name="duration">The duration of the tween</param>
/// <param name="axisConstraint">Eventual axis constraint for the rotation</param>
/// <param name="up">The vector that defines in which direction up is (default: Vector3.up)</param>
public static Tweener DOLookAt(this Rigidbody target, Vector3 towards, float duration, AxisConstraint axisConstraint = AxisConstraint.None, Vector3? up = null)
{
TweenerCore<Quaternion, Vector3, QuaternionOptions> 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
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param>
/// <param name="jumpPower">Power of the jump (the max height of the jump is represented by this plus the final Y offset)</param>
/// <param name="numJumps">Total number of jumps</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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;
}
/// <summary>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.
/// <para>NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.</para>
/// <para>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.</para></summary>
/// <param name="path">The waypoints to go through</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="pathType">The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)</param>
/// <param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
/// <param name="resolution">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</param>
/// <param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
public static TweenerCore<Vector3, Path, PathOptions> 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<Vector3, Path, PathOptions> 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;
}
/// <summary>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
/// <para>NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened.</para>
/// <para>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.</para></summary>
/// <param name="path">The waypoint to go through</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="pathType">The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path)</param>
/// <param name="pathMode">The path mode: 3D, side-scroller 2D, top-down 2D</param>
/// <param name="resolution">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</param>
/// <param name="gizmoColor">The color of the path (shown when gizmos are active in the Play panel and the tween is running)</param>
public static TweenerCore<Vector3, Path, PathOptions> 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<Vector3, Path, PathOptions> 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<Vector3, Path, PathOptions> DOPath(
this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D
)
{
TweenerCore<Vector3, Path, PathOptions> 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<Vector3, Path, PathOptions> DOLocalPath(
this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D
)
{
Transform trans = target.transform;
TweenerCore<Vector3, Path, PathOptions> 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

View File

@ -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
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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);
}
/// <summary>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</summary>
/// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
public static Tweener DORotate(this Rigidbody2D target, float endValue, float duration)
{
return DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration)
.SetTarget(target);
}
#region Special
/// <summary>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.
/// <para>IMPORTANT: a rigidbody2D can't be animated in a jump arc using MovePosition, so the tween will directly set the position</para></summary>
/// <param name="endValue">The end value to reach</param>
/// <param name="jumpPower">Power of the jump (the max height of the jump is represented by this plus the final Y offset)</param>
/// <param name="numJumps">Total number of jumps</param>
/// <param name="duration">The duration of the tween</param>
/// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
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

Some files were not shown because too many files have changed in this diff Show More