diff --git a/UnityExamples.Unity5/Assets/DOTween Examples/CustomPlugin Example/CustomRangePlugin.cs b/UnityExamples.Unity5/Assets/DOTween Examples/CustomPlugin Example/CustomRangePlugin.cs index 4bf6454..439b412 100644 --- a/UnityExamples.Unity5/Assets/DOTween Examples/CustomPlugin Example/CustomRangePlugin.cs +++ b/UnityExamples.Unity5/Assets/DOTween Examples/CustomPlugin Example/CustomRangePlugin.cs @@ -25,6 +25,13 @@ public class CustomRangePlugin : ABSTweenPlugin t, CustomRange fromValue, bool setImmediately) + { + t.startValue = fromValue; + if (setImmediately) t.setter(fromValue); + } + // Used by special plugins, just let it return the given value public override CustomRange ConvertToStartValue(TweenerCore t, CustomRange value) { diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween.XML b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween.XML index c7fd644..9d179a7 100644 --- a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween.XML +++ b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween.XML @@ -137,6 +137,17 @@ Public so it can be used by external ease factories + + + Behaviour in case a tween nested inside a Sequence fails + + + + If the Sequence contains other elements, kill the failed tween but preserve the rest + + + Kill the whole Sequence + Additional notices passed to plugins when updating. @@ -153,11 +164,52 @@ Lets the plugin know that we restarted or rewinded + + + OnRewind callback behaviour (can only be set via DOTween's Utility Panel) + + + + + When calling Rewind or PlayBackwards/SmoothRewind, OnRewind callbacks will be fired only if the tween isn't already rewinded + + + + + When calling Rewind, OnRewind callbacks will always be fired, even if the tween is already rewinded. + When calling PlayBackwards/SmoothRewind instead, OnRewind callbacks will be fired only if the tween isn't already rewinded + + + + + When calling Rewind or PlayBackwards/SmoothRewind, OnRewind callbacks will always be fired, even if the tween is already rewinded + + Public only so custom shortcuts can access some of these methods + + + INTERNAL: used by DO shortcuts and Modules to set special startup mode + + + + + INTERNAL: used by DO shortcuts and Modules to set the tween as blendable + + + + + INTERNAL: used by DO shortcuts and Modules to prevent a tween from using a From setup even if passed + + + + + Used to dispatch commands that need to be captured externally, usually by Modules + + Returns a Vector3 with z = 0 @@ -168,6 +220,43 @@ Returns the 2D angle between two vectors + + + Uses approximate equality on each axis instead of Unity's Vector3 equality, + because the latter fails (in some cases) when assigning a Vector3 to a transform.position and then checking it. + + + + + Looks for the type within all possible project assembly names + + + + NO-GC METHOD: changes the start value of a tween and rewinds it (without pausing it). + Has no effect with tweens that are inside Sequences + The new start value + If bigger than 0 applies it as the new tween duration + + + NO-GC METHOD: changes the end value of a tween and rewinds it (without pausing it). + Has no effect with tweens that are inside Sequences + The new end value + If TRUE the start value will become the current target's value, otherwise it will stay the same + + + NO-GC METHOD: changes the end value of a tween and rewinds it (without pausing it). + Has no effect with tweens that are inside Sequences + The new end value + If bigger than 0 applies it as the new tween duration + If TRUE the start value will become the current target's value, otherwise it will stay the same + + + NO-GC METHOD: changes the start and end value of a tween and rewinds it (without pausing it). + Has no effect with tweens that are inside Sequences + The new start value + The new end value + If bigger than 0 applies it as the new tween duration + Struct that stores two colors (used for LineRenderer tweens) @@ -210,6 +299,9 @@ INTERNAL: do not use + + INTERNAL: do not use + INTERNAL: do not use @@ -238,6 +330,10 @@ (like targets becoming null while a tween is playing). Default: TRUE + + Behaviour in case a tween nested inside a Sequence fails (caught by safe mode). + Default: NestedTweenFailureBehaviour.TryToPreserveSequence + If TRUE you will get a DOTween report when exiting play mode (only in the Editor). Useful to know how many max Tweeners and Sequences you reached and optimize your final project accordingly. @@ -264,6 +360,13 @@ DOTween's log behaviour. Default: LogBehaviour.ErrorsOnly + + Used to intercept DOTween's logs. If this method isn't NULL, DOTween will call it before writing a log via Unity's own Debug log methods. + Return TRUE if you want DOTween to proceed with the log, FALSE otherwise. + This method must return a bool and accept two parameters: + - LogType: the type of Unity log that DOTween is trying to log + - object: the log message that DOTween wants to log + If TRUE draws path gizmos in Unity Editor (if the gizmos button is active). Deactivate this if you want to avoid gizmos overhead while in Unity Editor @@ -304,6 +407,9 @@ Default period used for eases Default: 0 + + Used internally. Assigned/removed by DOTweenComponent.Create/DestroyInstance + Must be called once, before the first ever DOTween call/reference, @@ -366,6 +472,13 @@ BEWARE: this is a slightly expensive operation so use it with care + + + Updates all tweens that are set to . + + Manual deltaTime + Unscaled delta time (used with tweens set as timeScaleIndependent) + Tweens a property or field to the given value using default plugins A getter for the field or property to tween. @@ -721,34 +834,38 @@ A tween is considered as playing even if its delay is actually playing - + Returns a list of all active tweens in a playing state. Returns NULL if there are no active playing tweens. Beware: each time you call this method a new list is generated, so use it for debug only + If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations) - + Returns a list of all active tweens in a paused state. Returns NULL if there are no active paused tweens. Beware: each time you call this method a new list is generated, so use it for debug only + If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations) - + Returns a list of all active tweens with the given id. Returns NULL if there are no active tweens with the given id. Beware: each time you call this method a new list is generated - If TRUE returns only the tweens with the given ID that are currently playing + If TRUE returns only the tweens with the given ID that are currently playing + If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations) - + Returns a list of all active tweens with the given target. Returns NULL if there are no active tweens with the given target. Beware: each time you call this method a new list is generated If TRUE returns only the tweens with the given target that are currently playing + If NULL creates a new list, otherwise clears and fills this one (and thus saves allocations) @@ -861,6 +978,44 @@ Max Sequences capacity. Default: 50 + + + Behaviour that can be assigned when chaining a SetLink to a tween + + + + Pauses the tween when the link target is disabled + + + Pauses the tween when the link target is disabled, plays it when it's enabled + + + Pauses the tween when the link target is disabled, restarts it when it's enabled + + + Plays the tween when the link target is enabled + + + Restarts the tween when the link target is enabled + + + Kills the tween when the link target is disabled + + + Kills the tween when the link target is destroyed (becomes NULL). This is always active even if another behaviour is chosen + + + Completes the tween when the link target is disabled + + + Completes and kills the tween when the link target is disabled + + + Rewinds the tween (delay excluded) when the link target is disabled + + + Rewinds and kills the tween when the link target is disabled + Path mode (used to determine correct LookAt orientation) @@ -889,6 +1044,9 @@ Curved path (which uses Catmull-Rom curves) + + EXPERIMENTAL: Curved path (which uses Cubic Bezier curves, where each point requires two extra control points) + Path control point @@ -1201,16 +1359,6 @@ Methods that extend known Unity objects and allow to directly create and control tweens from their instances - - Tweens an AudioSource's volume to the given value. - Also stores the AudioSource as the tween's target so it can be used for filtered operations - The end value to reach (0 to 1)The duration of the tween - - - Tweens an AudioSource's pitch to the given value. - Also stores the AudioSource as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - Tweens a Camera's aspect to the given value. Also stores the camera as the tween's target so it can be used for filtered operations @@ -1326,6 +1474,13 @@ The name of the material property to tween (like _Tint or _SpecColor) The duration of the tween + + Tweens a Material's named color property with the given ID to the given value. + Also stores the material as the tween's target so it can be used for filtered operations + The end value to reach + The ID of the material property to tween (also called nameID in Unity's manual) + The duration of the tween + Tweens a Material's alpha color to the given value (will have no effect unless your material supports transparency). @@ -1340,6 +1495,14 @@ The name of the material property to tween (like _Tint or _SpecColor) The duration of the tween + + Tweens a Material's alpha color with the given ID to the given value + (will have no effect unless your material supports transparency). + Also stores the material as the tween's target so it can be used for filtered operations + The end value to reach + The ID of the material property to tween (also called nameID in Unity's manual) + The duration of the tween + Tweens a Material's named float property to the given value. Also stores the material as the tween's target so it can be used for filtered operations @@ -1347,6 +1510,13 @@ The name of the material property to tween The duration of the tween + + Tweens a Material's named float property with the given ID to the given value. + Also stores the material as the tween's target so it can be used for filtered operations + The end value to reach + The ID of the material property to tween (also called nameID in Unity's manual) + The duration of the tween + Tweens a Material's texture offset to the given value. Also stores the material as the tween's target so it can be used for filtered operations @@ -1380,80 +1550,12 @@ The name of the material property to tween The duration of the tween - - Tweens a Rigidbody's position to the given value. - Also stores the rigidbody as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Rigidbody's X position to the given value. - Also stores the rigidbody as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Rigidbody's Y position to the given value. - Also stores the rigidbody as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Rigidbody's Z position to the given value. - Also stores the rigidbody as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Rigidbody's rotation to the given value. - Also stores the rigidbody as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - Rotation mode - - - Tweens a Rigidbody's rotation so that it will look towards the given position. - Also stores the rigidbody as the tween's target so it can be used for filtered operations - The position to look atThe duration of the tween - Eventual axis constraint for the rotation - The vector that defines in which direction up is (default: Vector3.up) - - - Tweens a Rigidbody's position to the given value, while also applying a jump effect along the Y axis. - Returns a Sequence instead of a Tweener. - Also stores the Rigidbody as the tween's target so it can be used for filtered operations + + Tweens a Material's named Vector property with the given ID to the given value. + Also stores the material as the tween's target so it can be used for filtered operations The end value to reach - Power of the jump (the max height of the jump is represented by this plus the final Y offset) - Total number of jumps + The ID of the material property to tween (also called nameID in Unity's manual) The duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Rigidbody's position through the given path waypoints, using the chosen path algorithm. - Also stores the Rigidbody as the tween's target so it can be used for filtered operations. - NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened. - BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug). - If you plan to publish there you should use a regular transform.DOPath. - The waypoints to go through - The duration of the tween - The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path) - The path mode: 3D, side-scroller 2D, top-down 2D - The resolution of the path (useless in case of Linear paths): higher resolutions make for more detailed curved paths but are more expensive. - Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints - The color of the path (shown when gizmos are active in the Play panel and the tween is running) - - - Tweens a Rigidbody's localPosition through the given path waypoints, using the chosen path algorithm. - Also stores the Rigidbody as the tween's target so it can be used for filtered operations - NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened. - BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug). - If you plan to publish there you should use a regular transform.DOLocalPath. - The waypoint to go through - The duration of the tween - The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path) - The path mode: 3D, side-scroller 2D, top-down 2D - The resolution of the path: higher resolutions make for more detailed curved paths but are more expensive. - Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints - The color of the path (shown when gizmos are active in the Play panel and the tween is running) Tweens a TrailRenderer's startWidth/endWidth to the given value. @@ -1705,6 +1807,22 @@ Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints The color of the path (shown when gizmos are active in the Play panel and the tween is running) + + IMPORTANT: Unless you really know what you're doing, you should use the overload that accepts a Vector3 array instead. + Tweens a Transform's position via the given path. + Also stores the transform as the tween's target so it can be used for filtered operations + The path to use + The duration of the tween + The path mode: 3D, side-scroller 2D, top-down 2D + + + IMPORTANT: Unless you really know what you're doing, you should use the overload that accepts a Vector3 array instead. + Tweens a Transform's localPosition via the given path. + Also stores the transform as the tween's target so it can be used for filtered operations + The path to use + The duration of the tween + The path mode: 3D, side-scroller 2D, top-down 2D + Tweens a Tween's timeScale to the given value. Also stores the Tween as the tween's target so it can be used for filtered operations @@ -1733,6 +1851,15 @@ The name of the material property to tween (like _Tint or _SpecColor) The duration of the tween + + Tweens a Material's named color property with the given ID 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 Material as the tween's target so it can be used for filtered operations + The value to tween to + The ID of the material property to tween (also called nameID in Unity's manual) + The duration of the tween + Tweens a Transform's position BY the given value (as if you chained a SetRelative), in a way that allows other DOBlendableMove tweens to work together on the same target, @@ -1765,6 +1892,17 @@ The value to tween byThe duration of the tween Rotation mode + + Punches a Transform's localRotation BY the given value and then back to the starting one + as if it was connected to the starting rotation via an elastic. Does it in a way that allows other + DOBlendableRotate tweens to work together on the same target + The punch strength (added to the Transform's current rotation) + The duration of the tween + Indicates how much will the punch vibrate + Represents how much (0 to 1) the vector will go beyond the starting rotation when bouncing backwards. + 1 creates a full oscillation between the punch rotation and the opposite rotation, + while 0 oscillates only between the punch and the start rotation + Tweens a Transform's localScale BY the given value (as if you chained a SetRelative), in a way that allows other DOBlendableScale tweens to work together on the same target, @@ -2077,17 +2215,40 @@ - Sets the autoKill behaviour of the tween. - Has no effect if the tween has already started + Sets the autoKill behaviour of the tween to TRUE. + Has no effect if the tween has already started or if it's added to a Sequence Sets the autoKill behaviour of the tween. - Has no effect if the tween has already started + Has no effect if the tween has already started or if it's added to a Sequence If TRUE the tween will be automatically killed when complete - Sets an ID for the tween, which can then be used as a filter with DOTween's static methods. - The ID to assign to this tween. Can be an int, a string, an object or anything else. + Sets an ID for the tween (), which can then be used as a filter with DOTween's static methods. + The ID to assign to this tween. Can be an int, a string, an object or anything else. + + + Sets a string ID for the tween (), which can then be used as a filter with DOTween's static methods. + Filtering via string is 2X faster than using an object as an ID (using the alternate obejct overload) + The string ID to assign to this tween. + + + Sets an int ID for the tween (), which can then be used as a filter with DOTween's static methods. + Filtering via int is 4X faster than via object, 2X faster than via string (using the alternate object/string overloads) + The int ID to assign to this tween. + + + Allows to link this tween to a GameObject + so that it will be automatically killed when the GameObject is destroyed. + Has no effect if the tween is added to a Sequence + The link target (unrelated to the target set via SetTarget) + + + Allows to link this tween to a GameObject and assign a behaviour depending on it. + This will also automatically kill the tween when the GameObject is destroyed. + Has no effect if the tween is added to a Sequence + The link target (unrelated to the target set via SetTarget) + The behaviour to use ( is always evaluated even if you choose another one) Sets the target for the tween, which can then be used as a filter with DOTween's static methods. @@ -2161,43 +2322,43 @@ If TRUE the tween will ignore Unity's Time.timeScale - Sets the onStart callback for the tween. + Sets the onStart callback for the tween, clearing any previous onStart callback that was set. Called the first time the tween is set in a playing state, after any eventual delay - Sets the onPlay callback for the tween. + Sets the onPlay callback for the tween, clearing any previous onPlay callback that was set. Called when the tween is set in a playing state, after any eventual delay. Also called each time the tween resumes playing from a paused state - Sets the onPlay callback for the tween. + Sets the onPause callback for the tween, clearing any previous onPause callback that was set. Called when the tween state changes from playing to paused. If the tween has autoKill set to FALSE, this is called also when the tween reaches completion. - Sets the onRewind callback for the tween. + Sets the onRewind callback for the tween, clearing any previous onRewind callback that was set. Called when the tween is rewinded, either by calling Rewind or by reaching the start position while playing backwards. Rewinding a tween that is already rewinded will not fire this callback - Sets the onUpdate callback for the tween. + Sets the onUpdate callback for the tween, clearing any previous onUpdate callback that was set. Called each time the tween updates - Sets the onStepComplete callback for the tween. + Sets the onStepComplete callback for the tween, clearing any previous onStepComplete callback that was set. Called the moment the tween completes one loop cycle, even when going backwards - Sets the onComplete callback for the tween. + Sets the onComplete callback for the tween, clearing any previous onComplete callback that was set. Called the moment the tween reaches its final forward position, loops included - Sets the onKill callback for the tween. + Sets the onKill callback for the tween, clearing any previous onKill callback that was set. Called the moment the tween is killed - Sets the onWaypointChange callback for the tween. + Sets the onWaypointChange callback for the tween, clearing any previous onWaypointChange callback that was set. Called when a path tween's current waypoint changes @@ -2270,6 +2431,24 @@ then immediately sends the target to the previously set endValue. If TRUE the FROM value will be calculated as relative to the current one + + Changes a TO tween into a FROM tween: sets the tween's starting value to the given one + and eventually sets the tween's target to that value immediately. + Value to start from + If TRUE sets the target to from value immediately, otherwise waits for the tween to start + + + Changes a TO tween into a FROM tween: sets the tween's starting value to the given one + and eventually sets the tween's target to that value immediately. + Alpha value to start from (in case of Fade tweens) + If TRUE sets the target to from value immediately, otherwise waits for the tween to start + + + Changes a TO tween into a FROM tween: sets the tween's starting value to the given one + and eventually sets the tween's target to that value immediately. + Value to start from (in case of Vector tweens that act on a single coordinate or scale tweens) + If TRUE sets the target to from value immediately, otherwise waits for the tween to start + Sets a delayed startup for the tween. Has no effect on Sequences or if the tween has already started @@ -2423,10 +2602,18 @@ If TRUE the tween wil go backwards - Id (usable for filtering with DOTween static methods). Can be an int, a string, an object, or anything else + Object ID (usable for filtering with DOTween static methods). Can be anything except a string or an int + (use or for those) + + + String ID (usable for filtering with DOTween static methods). 2X faster than using an object id + + + Int ID (usable for filtering with DOTween static methods). 4X faster than using an object id, 2X faster than using a string id. + Default is -999 so avoid using an ID like that or it will capture all unset intIds - Tween target (usable for filtering with DOTween static methods). Automatically set by tween creation shorcuts + Tween target (usable for filtering with DOTween static methods). Automatically set by tween creation shortcuts Called when the tween is set in a playing state, after any eventual delay. @@ -2456,9 +2643,21 @@ Called when a path tween's current waypoint changes + + Tweeners-only (ignored by Sequences), returns TRUE if the tween was set as relative + + + FALSE when tween is (or should be) despawned - set only by TweenManager + Gets and sets the time position (loops included, delays excluded) of the tween + + TRUE after the tween was set in a play state at least once, AFTER any delay is elapsed + + + Time position within a single loop cycle + Animates a single value @@ -2509,5 +2708,8 @@ Updates using FixedUpdate calls + + Updates using manual update calls + diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween.dll b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween.dll index 53865dc..6484221 100644 Binary files a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween.dll and b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween.dll differ diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb index 7efad50..46593ad 100644 Binary files a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb and b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb differ diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween43.dll b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween43.dll deleted file mode 100644 index d8cb0c0..0000000 Binary files a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween43.dll and /dev/null differ diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb deleted file mode 100644 index f00e848..0000000 Binary files a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb and /dev/null differ diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb.meta b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb.meta deleted file mode 100644 index b787f6d..0000000 --- a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.mdb.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: daa90d7807e5d524ea1efa4d20b2de6f -timeCreated: 1427036874 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.meta b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.meta deleted file mode 100644 index 4230b41..0000000 --- a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween43.dll.meta +++ /dev/null @@ -1,24 +0,0 @@ -fileFormatVersion: 2 -guid: 96124212a8a434c4baaaff8cf6006657 -timeCreated: 1427036875 -licenseType: Pro -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 1 - settings: {} - Editor: - enabled: 0 - settings: - DefaultValueInitialized: true - WindowsStoreApps: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween43.xml b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween43.xml deleted file mode 100644 index f0efe2b..0000000 --- a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween43.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - DOTween43 - - - - - Methods that extend known Unity objects and allow to directly create and control tweens from their instances. - These, as all DOTween43 methods, require Unity 4.3 or later. - - - - Tweens a Material's color using the given gradient - (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). - Also stores the image as the tween's target so it can be used for filtered operations - The gradient to useThe duration of the tween - - - Tweens a Material's named color property using the given gradient - (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). - Also stores the image as the tween's target so it can be used for filtered operations - The gradient to use - The name of the material property to tween (like _Tint or _SpecColor) - The duration of the tween - - - Tweens a SpriteRenderer's color to the given value. - Also stores the spriteRenderer as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Material's alpha color to the given value. - Also stores the spriteRenderer as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a SpriteRenderer's color using the given gradient - (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). - Also stores the image as the tween's target so it can be used for filtered operations - The gradient to useThe duration of the tween - - - Tweens a Rigidbody2D's position to the given value. - Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Rigidbody2D's X position to the given value. - Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Rigidbody2D's Y position to the given value. - Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Rigidbody2D's rotation to the given value. - Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Rigidbody2D's position to the given value, while also applying a jump effect along the Y axis. - Returns a Sequence instead of a Tweener. - Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations. - IMPORTANT: a rigidbody2D can't be animated in a jump arc using MovePosition, so the tween will directly set the position - The end value to reach - Power of the jump (the max height of the jump is represented by this plus the final Y offset) - Total number of jumps - The duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a SpriteRenderer's color to the given value, - in a way that allows other DOBlendableColor tweens to work together on the same target, - instead than fight each other as multiple DOColor would do. - Also stores the SpriteRenderer as the tween's target so it can be used for filtered operations - The value to tween toThe duration of the tween - - - diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween43.xml.meta b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween43.xml.meta deleted file mode 100644 index 8d98b42..0000000 --- a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween43.xml.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: bee01d69fe6a7fe40b5abe7cf7256796 -timeCreated: 1427036876 -licenseType: Pro -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween46.dll b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween46.dll deleted file mode 100644 index 78b1820..0000000 Binary files a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween46.dll and /dev/null differ diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb deleted file mode 100644 index 0ae8cbd..0000000 Binary files a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb and /dev/null differ diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb.meta b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb.meta deleted file mode 100644 index 82eb3ab..0000000 --- a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.mdb.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0cefc8c9f88432a4691eda55a1455277 -timeCreated: 1427036874 -licenseType: Pro -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.meta b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.meta deleted file mode 100644 index 2bcabf3..0000000 --- a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween46.dll.meta +++ /dev/null @@ -1,24 +0,0 @@ -fileFormatVersion: 2 -guid: e533a471b73bc124e9b533b673c8fcde -timeCreated: 1427036876 -licenseType: Pro -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 1 - settings: {} - Editor: - enabled: 0 - settings: - DefaultValueInitialized: true - WindowsStoreApps: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween46.xml b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween46.xml deleted file mode 100644 index 1118c89..0000000 --- a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween46.xml +++ /dev/null @@ -1,261 +0,0 @@ - - - - DOTween46 - - - - - Various utils that require Unity 4.6 or later - - - - - Converts the anchoredPosition of the first RectTransform to the second RectTransform, - taking into consideration offset, anchors and pivot, and returns the new anchoredPosition - - - - - Methods that extend known Unity objects and allow to directly create and control tweens from their instances. - These, as all DOTween46 methods, require Unity 4.6 or later. - - - - Tweens a CanvasGroup's alpha color to the given value. - Also stores the canvasGroup as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens an Graphic's color to the given value. - Also stores the image as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens an Graphic's alpha color to the given value. - Also stores the image as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens an Image's color to the given value. - Also stores the image as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens an Image's alpha color to the given value. - Also stores the image as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens an Image's fillAmount to the given value. - Also stores the image as the tween's target so it can be used for filtered operations - The end value to reach (0 to 1)The duration of the tween - - - Tweens an Image's colors using the given gradient - (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). - Also stores the image as the tween's target so it can be used for filtered operations - The gradient to useThe duration of the tween - - - Tweens an LayoutElement's flexibleWidth/Height to the given value. - Also stores the LayoutElement as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens an LayoutElement's minWidth/Height to the given value. - Also stores the LayoutElement as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens an LayoutElement's preferredWidth/Height to the given value. - Also stores the LayoutElement as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Outline's effectColor to the given value. - Also stores the Outline as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Outline's effectColor alpha to the given value. - Also stores the Outline as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Outline's effectDistance to the given value. - Also stores the Outline as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a RectTransform's anchoredPosition to the given value. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a RectTransform's anchoredPosition X to the given value. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a RectTransform's anchoredPosition Y to the given value. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a RectTransform's anchoredPosition3D to the given value. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a RectTransform's anchorMax to the given value. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a RectTransform's anchorMin to the given value. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a RectTransform's pivot to the given value. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a RectTransform's pivot X to the given value. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a RectTransform's pivot Y to the given value. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a RectTransform's sizeDelta to the given value. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Punches a RectTransform's anchoredPosition towards the given direction and then back to the starting one - as if it was connected to the starting position via an elastic. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The direction and strength of the punch (added to the RectTransform's current position) - The duration of the tween - Indicates how much will the punch vibrate - Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards. - 1 creates a full oscillation between the punch direction and the opposite direction, - while 0 oscillates only between the punch and the start position - If TRUE the tween will smoothly snap all values to integers - - - Shakes a RectTransform's anchoredPosition with the given values. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The duration of the tween - The shake strength - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - If TRUE the tween will smoothly snap all values to integers - If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not - - - Shakes a RectTransform's anchoredPosition with the given values. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The duration of the tween - The shake strength on each axis - Indicates how much will the shake vibrate - Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). - Setting it to 0 will shake along a single direction. - If TRUE the tween will smoothly snap all values to integers - If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not - - - Tweens a RectTransform's anchoredPosition to the given value, while also applying a jump effect along the Y axis. - Returns a Sequence instead of a Tweener. - Also stores the RectTransform as the tween's target so it can be used for filtered operations - The end value to reach - Power of the jump (the max height of the jump is represented by this plus the final Y offset) - Total number of jumps - The duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a ScrollRect's horizontal/verticalNormalizedPosition to the given value. - Also stores the ScrollRect as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a ScrollRect's horizontalNormalizedPosition to the given value. - Also stores the ScrollRect as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a ScrollRect's verticalNormalizedPosition to the given value. - Also stores the ScrollRect as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Slider's value to the given value. - Also stores the Slider as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - If TRUE the tween will smoothly snap all values to integers - - - Tweens a Text's color to the given value. - Also stores the Text as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Text's alpha color to the given value. - Also stores the Text as the tween's target so it can be used for filtered operations - The end value to reachThe duration of the tween - - - Tweens a Text's text to the given value. - Also stores the Text as the tween's target so it can be used for filtered operations - The end string to tween toThe duration of the tween - If TRUE (default), rich text will be interpreted correctly while animated, - otherwise all tags will be considered as normal text - The type of scramble mode to use, if any - A string containing the characters to use for scrambling. - Use as many characters as possible (minimum 10) because DOTween uses a fast scramble mode which gives better results with more characters. - Leave it to NULL (default) to use default ones - - - Tweens a Graphic's color to the given value, - in a way that allows other DOBlendableColor tweens to work together on the same target, - instead than fight each other as multiple DOColor would do. - Also stores the Graphic as the tween's target so it can be used for filtered operations - The value to tween toThe duration of the tween - - - Tweens a Image's color to the given value, - in a way that allows other DOBlendableColor tweens to work together on the same target, - instead than fight each other as multiple DOColor would do. - Also stores the Image as the tween's target so it can be used for filtered operations - The value to tween toThe duration of the tween - - - Tweens a Text's color BY the given value, - in a way that allows other DOBlendableColor tweens to work together on the same target, - instead than fight each other as multiple DOColor would do. - Also stores the Text as the tween's target so it can be used for filtered operations - The value to tween toThe duration of the tween - - - diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween46.xml.meta b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween46.xml.meta deleted file mode 100644 index 5599a23..0000000 --- a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween46.xml.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 11b4db111ab0d92449c73aa232309358 -timeCreated: 1427036876 -licenseType: Pro -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween50.dll b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween50.dll deleted file mode 100644 index bbc9a43..0000000 Binary files a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween50.dll and /dev/null differ diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.mdb b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.mdb deleted file mode 100644 index e3ed7ac..0000000 Binary files a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.mdb and /dev/null differ diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.meta b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.meta deleted file mode 100644 index 3ff8968..0000000 --- a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.meta +++ /dev/null @@ -1,24 +0,0 @@ -fileFormatVersion: 2 -guid: 244f321fc1b65154cb9485465856c92f -timeCreated: 1427036875 -licenseType: Pro -PluginImporter: - serializedVersion: 1 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - platformData: - Any: - enabled: 1 - settings: {} - Editor: - enabled: 0 - settings: - DefaultValueInitialized: true - WindowsStoreApps: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween50.xml b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween50.xml deleted file mode 100644 index 7952aa7..0000000 --- a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween50.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - DOTween50 - - - - - Methods that extend known Unity objects and allow to directly create and control tweens from their instances. - These, as all DOTween50 methods, require Unity 5.0 or later. - - - - Tweens an AudioMixer's exposed float to the given value. - Also stores the AudioMixer as the tween's target so it can be used for filtered operations. - Note that you need to manually expose a float in an AudioMixerGroup in order to be able to tween it from an AudioMixer. - Name given to the exposed float to set - The end value to reachThe duration of the tween - - - - Completes all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens completed - (meaning the tweens that don't have infinite loops and were not already complete) - - For Sequences only: if TRUE also internal Sequence callbacks will be fired, - otherwise they will be ignored - - - - Kills all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens killed. - - If TRUE completes the tween before killing it - - - - Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens flipped. - - - - - Sends to the given position all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens involved. - - Time position to reach - (if higher than the whole tween duration the tween will simply reach its end) - If TRUE will play the tween after reaching the given position, otherwise it will pause it - - - - Pauses all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens paused. - - - - - Plays all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens played. - - - - - Plays backwards all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens played. - - - - - Plays forward all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens played. - - - - - Restarts all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens restarted. - - - - - Rewinds all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens rewinded. - - - - - Smoothly rewinds all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens rewinded. - - - - - Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference - (meaning tweens that were started from this target, or that had this target added as an Id) - and returns the total number of tweens involved. - - - - diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween50.xml.meta b/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween50.xml.meta deleted file mode 100644 index 506fe3b..0000000 --- a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween50.xml.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 77cae47a46077594587f7b82623ca74c -timeCreated: 1427036876 -licenseType: Pro -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML index 6afe743..92ab578 100644 --- a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML +++ b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.XML @@ -4,37 +4,58 @@ DOTweenEditor - + + + Starts the update loop of tween in the editor. Has no effect during playMode. + + Eventual callback to call after every update + + + + Stops the update loop and clears the onPreviewUpdated callback. + + If TRUE also resets the tweened objects to their original state + + + + Readies the tween for editor preview by setting its UpdateType to Manual plus eventual extra settings. + + The tween to ready + If TRUE (recommended) removes all callbacks (OnComplete/Rewind/etc) + If TRUE prevents the tween from being auto-killed at completion + If TRUE starts playing the tween immediately + + Checks that the given editor texture use the correct import settings, and applies them if they're incorrect. - + - Returns TRUE if addons setup is required. + Returns TRUE if setup is required - + Returns TRUE if the file/directory at the given path exists. Path, relative to Unity's project folder - + Converts the given project-relative path to a full path, with backward (\) slashes). - + Converts the given full path to a path usable with AssetDatabase methods (relative to Unity's project folder, and with the correct Unity forward (/) slashes). - + Connects to a asset. If the asset already exists at the given path, loads it and returns it. @@ -45,21 +66,33 @@ File path (relative to Unity's project folder) If TRUE and the requested asset doesn't exist, forces its creation - + Full path for the given loaded assembly, assembly file included - + + + Adds the given global define if it's not already present + + + + + Removes the given global define if it's present + + + + + Returns TRUE if the given global define is present in all the + or only in the given , depending on passed parameters. + + + to use. Leave NULL to check in all of them. + + Not used as menu item anymore, but as a utiity function - - - Setups DOTween - - If TRUE, no warning window appears in case there is no need for setup - diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll index 80a96a1..b78b86d 100644 Binary files a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll and b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll differ diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb index c1446e4..5ab8116 100644 Binary files a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb and b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb differ diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.mdb.meta b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules.meta similarity index 58% rename from UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.mdb.meta rename to UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules.meta index 4788b25..2b6951b 100644 --- a/UnityExamples.Unity5/Assets/Demigiant/DOTween/DOTween50.dll.mdb.meta +++ b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules.meta @@ -1,6 +1,7 @@ fileFormatVersion: 2 -guid: 305308bb99989414fa15ec8e339b70b0 -timeCreated: 1427036874 +guid: a8aaba8675a8ddc41b00c35c85e249a8 +folderAsset: yes +timeCreated: 1571306499 licenseType: Pro DefaultImporter: userData: diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs new file mode 100644 index 0000000..c195b6c --- /dev/null +++ b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs @@ -0,0 +1,202 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2018/07/13 + +#if true // MODULE_MARKER +using System; +using DG.Tweening.Core; +using DG.Tweening.Plugins.Options; +using UnityEngine; +#if UNITY_5 || UNITY_2017_1_OR_NEWER +using UnityEngine.Audio; // Required for AudioMixer +#endif + +#pragma warning disable 1591 +namespace DG.Tweening +{ + public static class DOTweenModuleAudio + { + #region Shortcuts + + #region Audio + + /// Tweens an AudioSource's volume to the given value. + /// Also stores the AudioSource as the tween's target so it can be used for filtered operations + /// The end value to reach (0 to 1)The duration of the tween + public static TweenerCore DOFade(this AudioSource target, float endValue, float duration) + { + if (endValue < 0) endValue = 0; + else if (endValue > 1) endValue = 1; + TweenerCore t = DOTween.To(() => target.volume, x => target.volume = x, endValue, duration); + t.SetTarget(target); + return t; + } + + /// Tweens an AudioSource's pitch to the given value. + /// Also stores the AudioSource as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static TweenerCore DOPitch(this AudioSource target, float endValue, float duration) + { + TweenerCore t = DOTween.To(() => target.pitch, x => target.pitch = x, endValue, duration); + t.SetTarget(target); + return t; + } + + #endregion + +#if UNITY_5 || UNITY_2017_1_OR_NEWER + #region AudioMixer (Unity 5 or Newer) + + /// Tweens an AudioMixer's exposed float to the given value. + /// Also stores the AudioMixer as the tween's target so it can be used for filtered operations. + /// Note that you need to manually expose a float in an AudioMixerGroup in order to be able to tween it from an AudioMixer. + /// Name given to the exposed float to set + /// The end value to reachThe duration of the tween + public static TweenerCore DOSetFloat(this AudioMixer target, string floatName, float endValue, float duration) + { + TweenerCore t = DOTween.To(()=> { + float currVal; + target.GetFloat(floatName, out currVal); + return currVal; + }, x=> target.SetFloat(floatName, x), endValue, duration); + t.SetTarget(target); + return t; + } + + #region Operation Shortcuts + + /// + /// Completes all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens completed + /// (meaning the tweens that don't have infinite loops and were not already complete) + /// + /// For Sequences only: if TRUE also internal Sequence callbacks will be fired, + /// otherwise they will be ignored + public static int DOComplete(this AudioMixer target, bool withCallbacks = false) + { + return DOTween.Complete(target, withCallbacks); + } + + /// + /// Kills all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens killed. + /// + /// If TRUE completes the tween before killing it + public static int DOKill(this AudioMixer target, bool complete = false) + { + return DOTween.Kill(target, complete); + } + + /// + /// Flips the direction (backwards if it was going forward or viceversa) of all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens flipped. + /// + public static int DOFlip(this AudioMixer target) + { + return DOTween.Flip(target); + } + + /// + /// Sends to the given position all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens involved. + /// + /// Time position to reach + /// (if higher than the whole tween duration the tween will simply reach its end) + /// If TRUE will play the tween after reaching the given position, otherwise it will pause it + public static int DOGoto(this AudioMixer target, float to, bool andPlay = false) + { + return DOTween.Goto(target, to, andPlay); + } + + /// + /// Pauses all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens paused. + /// + public static int DOPause(this AudioMixer target) + { + return DOTween.Pause(target); + } + + /// + /// Plays all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens played. + /// + public static int DOPlay(this AudioMixer target) + { + return DOTween.Play(target); + } + + /// + /// Plays backwards all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens played. + /// + public static int DOPlayBackwards(this AudioMixer target) + { + return DOTween.PlayBackwards(target); + } + + /// + /// Plays forward all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens played. + /// + public static int DOPlayForward(this AudioMixer target) + { + return DOTween.PlayForward(target); + } + + /// + /// Restarts all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens restarted. + /// + public static int DORestart(this AudioMixer target) + { + return DOTween.Restart(target); + } + + /// + /// Rewinds all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens rewinded. + /// + public static int DORewind(this AudioMixer target) + { + return DOTween.Rewind(target); + } + + /// + /// Smoothly rewinds all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens rewinded. + /// + public static int DOSmoothRewind(this AudioMixer target) + { + return DOTween.SmoothRewind(target); + } + + /// + /// Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference + /// (meaning tweens that were started from this target, or that had this target added as an Id) + /// and returns the total number of tweens involved. + /// + public static int DOTogglePause(this AudioMixer target) + { + return DOTween.TogglePause(target); + } + + #endregion + + #endregion +#endif + + #endregion + } +} +#endif diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs.meta b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs.meta new file mode 100644 index 0000000..55b7757 --- /dev/null +++ b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleAudio.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 35cdca364a187914bb323f7087eade56 +timeCreated: 1571306506 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs new file mode 100644 index 0000000..a1a1cb9 --- /dev/null +++ b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs @@ -0,0 +1,216 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2018/07/13 + +#if true // MODULE_MARKER +using System; +using DG.Tweening.Core; +using DG.Tweening.Core.Enums; +using DG.Tweening.Plugins; +using DG.Tweening.Plugins.Core.PathCore; +using DG.Tweening.Plugins.Options; +using UnityEngine; + +#pragma warning disable 1591 +namespace DG.Tweening +{ + public static class DOTweenModulePhysics + { + #region Shortcuts + + #region Rigidbody + + /// Tweens a Rigidbody's position to the given value. + /// Also stores the rigidbody as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOMove(this Rigidbody target, Vector3 endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.position, target.MovePosition, endValue, duration); + t.SetOptions(snapping).SetTarget(target); + return t; + } + + /// Tweens a Rigidbody's X position to the given value. + /// Also stores the rigidbody as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOMoveX(this Rigidbody target, float endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue, 0, 0), duration); + t.SetOptions(AxisConstraint.X, snapping).SetTarget(target); + return t; + } + + /// Tweens a Rigidbody's Y position to the given value. + /// Also stores the rigidbody as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOMoveY(this Rigidbody target, float endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, endValue, 0), duration); + t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target); + return t; + } + + /// Tweens a Rigidbody's Z position to the given value. + /// Also stores the rigidbody as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOMoveZ(this Rigidbody target, float endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, 0, endValue), duration); + t.SetOptions(AxisConstraint.Z, snapping).SetTarget(target); + return t; + } + + /// Tweens a Rigidbody's rotation to the given value. + /// Also stores the rigidbody as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// Rotation mode + public static TweenerCore DORotate(this Rigidbody target, Vector3 endValue, float duration, RotateMode mode = RotateMode.Fast) + { + TweenerCore t = DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration); + t.SetTarget(target); + t.plugOptions.rotateMode = mode; + return t; + } + + /// Tweens a Rigidbody's rotation so that it will look towards the given position. + /// Also stores the rigidbody as the tween's target so it can be used for filtered operations + /// The position to look atThe duration of the tween + /// Eventual axis constraint for the rotation + /// The vector that defines in which direction up is (default: Vector3.up) + public static TweenerCore DOLookAt(this Rigidbody target, Vector3 towards, float duration, AxisConstraint axisConstraint = AxisConstraint.None, Vector3? up = null) + { + TweenerCore t = DOTween.To(() => target.rotation, target.MoveRotation, towards, duration) + .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetLookAt); + t.plugOptions.axisConstraint = axisConstraint; + t.plugOptions.up = (up == null) ? Vector3.up : (Vector3)up; + return t; + } + + #region Special + + /// Tweens a Rigidbody's position to the given value, while also applying a jump effect along the Y axis. + /// Returns a Sequence instead of a Tweener. + /// Also stores the Rigidbody as the tween's target so it can be used for filtered operations + /// The end value to reach + /// Power of the jump (the max height of the jump is represented by this plus the final Y offset) + /// Total number of jumps + /// The duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Sequence DOJump(this Rigidbody target, Vector3 endValue, float jumpPower, int numJumps, float duration, bool snapping = false) + { + if (numJumps < 1) numJumps = 1; + float startPosY = 0; + float offsetY = -1; + bool offsetYSet = false; + Sequence s = DOTween.Sequence(); + Tween yTween = DOTween.To(() => target.position, target.MovePosition, new Vector3(0, jumpPower, 0), duration / (numJumps * 2)) + .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative() + .SetLoops(numJumps * 2, LoopType.Yoyo) + .OnStart(() => startPosY = target.position.y); + s.Append(DOTween.To(() => target.position, target.MovePosition, new Vector3(endValue.x, 0, 0), duration) + .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) + ).Join(DOTween.To(() => target.position, target.MovePosition, new Vector3(0, 0, endValue.z), duration) + .SetOptions(AxisConstraint.Z, snapping).SetEase(Ease.Linear) + ).Join(yTween) + .SetTarget(target).SetEase(DOTween.defaultEaseType); + yTween.OnUpdate(() => { + if (!offsetYSet) { + offsetYSet = true; + offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; + } + Vector3 pos = target.position; + pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad); + target.MovePosition(pos); + }); + return s; + } + + /// Tweens a Rigidbody's position through the given path waypoints, using the chosen path algorithm. + /// Also stores the Rigidbody as the tween's target so it can be used for filtered operations. + /// NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened. + /// BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug). + /// If you plan to publish there you should use a regular transform.DOPath. + /// The waypoints to go through + /// The duration of the tween + /// The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path) + /// The path mode: 3D, side-scroller 2D, top-down 2D + /// The resolution of the path (useless in case of Linear paths): higher resolutions make for more detailed curved paths but are more expensive. + /// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints + /// The color of the path (shown when gizmos are active in the Play panel and the tween is running) + public static TweenerCore DOPath( + this Rigidbody target, Vector3[] path, float duration, PathType pathType = PathType.Linear, + PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null + ) + { + if (resolution < 1) resolution = 1; + TweenerCore t = DOTween.To(PathPlugin.Get(), () => target.position, target.MovePosition, new Path(pathType, path, resolution, gizmoColor), duration) + .SetTarget(target).SetUpdate(UpdateType.Fixed); + + t.plugOptions.isRigidbody = true; + t.plugOptions.mode = pathMode; + return t; + } + /// Tweens a Rigidbody's localPosition through the given path waypoints, using the chosen path algorithm. + /// Also stores the Rigidbody as the tween's target so it can be used for filtered operations + /// NOTE: to tween a rigidbody correctly it should be set to kinematic at least while being tweened. + /// BEWARE: doesn't work on Windows Phone store (waiting for Unity to fix their own bug). + /// If you plan to publish there you should use a regular transform.DOLocalPath. + /// The waypoint to go through + /// The duration of the tween + /// The type of path: Linear (straight path) or CatmullRom (curved CatmullRom path) + /// The path mode: 3D, side-scroller 2D, top-down 2D + /// The resolution of the path: higher resolutions make for more detailed curved paths but are more expensive. + /// Defaults to 10, but a value of 5 is usually enough if you don't have dramatic long curves between waypoints + /// The color of the path (shown when gizmos are active in the Play panel and the tween is running) + public static TweenerCore DOLocalPath( + this Rigidbody target, Vector3[] path, float duration, PathType pathType = PathType.Linear, + PathMode pathMode = PathMode.Full3D, int resolution = 10, Color? gizmoColor = null + ) + { + if (resolution < 1) resolution = 1; + Transform trans = target.transform; + TweenerCore t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), new Path(pathType, path, resolution, gizmoColor), duration) + .SetTarget(target).SetUpdate(UpdateType.Fixed); + + t.plugOptions.isRigidbody = true; + t.plugOptions.mode = pathMode; + t.plugOptions.useLocalPosition = true; + return t; + } + // Used by path editor when creating the actual tween, so it can pass a pre-compiled path + internal static TweenerCore DOPath( + this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D + ) + { + TweenerCore t = DOTween.To(PathPlugin.Get(), () => target.position, target.MovePosition, path, duration) + .SetTarget(target); + + t.plugOptions.isRigidbody = true; + t.plugOptions.mode = pathMode; + return t; + } + internal static TweenerCore DOLocalPath( + this Rigidbody target, Path path, float duration, PathMode pathMode = PathMode.Full3D + ) + { + Transform trans = target.transform; + TweenerCore t = DOTween.To(PathPlugin.Get(), () => trans.localPosition, x => target.MovePosition(trans.parent == null ? x : trans.parent.TransformPoint(x)), path, duration) + .SetTarget(target); + + t.plugOptions.isRigidbody = true; + t.plugOptions.mode = pathMode; + t.plugOptions.useLocalPosition = true; + return t; + } + + #endregion + + #endregion + + #endregion + } +} +#endif diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs.meta b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs.meta new file mode 100644 index 0000000..5288d26 --- /dev/null +++ b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a2c8eb01e28f57043873d9e80957dcb2 +timeCreated: 1571306506 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs new file mode 100644 index 0000000..f40a7d0 --- /dev/null +++ b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs @@ -0,0 +1,107 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2018/07/13 + +#if true && (UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER) // MODULE_MARKER +using System; +using DG.Tweening.Core; +using DG.Tweening.Plugins.Options; +using UnityEngine; + +#pragma warning disable 1591 +namespace DG.Tweening +{ + public static class DOTweenModulePhysics2D + { + #region Shortcuts + + #region Rigidbody2D Shortcuts + + /// Tweens a Rigidbody2D's position to the given value. + /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOMove(this Rigidbody2D target, Vector2 endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.position, target.MovePosition, endValue, duration); + t.SetOptions(snapping).SetTarget(target); + return t; + } + + /// Tweens a Rigidbody2D's X position to the given value. + /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOMoveX(this Rigidbody2D target, float endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.position, target.MovePosition, new Vector2(endValue, 0), duration); + t.SetOptions(AxisConstraint.X, snapping).SetTarget(target); + return t; + } + + /// Tweens a Rigidbody2D's Y position to the given value. + /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOMoveY(this Rigidbody2D target, float endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.position, target.MovePosition, new Vector2(0, endValue), duration); + t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target); + return t; + } + + /// Tweens a Rigidbody2D's rotation to the given value. + /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static TweenerCore DORotate(this Rigidbody2D target, float endValue, float duration) + { + TweenerCore t = DOTween.To(() => target.rotation, target.MoveRotation, endValue, duration); + t.SetTarget(target); + return t; + } + + #region Special + + /// Tweens a Rigidbody2D's position to the given value, while also applying a jump effect along the Y axis. + /// Returns a Sequence instead of a Tweener. + /// Also stores the Rigidbody2D as the tween's target so it can be used for filtered operations. + /// IMPORTANT: a rigidbody2D can't be animated in a jump arc using MovePosition, so the tween will directly set the position + /// The end value to reach + /// Power of the jump (the max height of the jump is represented by this plus the final Y offset) + /// Total number of jumps + /// The duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Sequence DOJump(this Rigidbody2D target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false) + { + if (numJumps < 1) numJumps = 1; + float startPosY = 0; + float offsetY = -1; + bool offsetYSet = false; + Sequence s = DOTween.Sequence(); + Tween yTween = DOTween.To(() => target.position, x => target.position = x, new Vector2(0, jumpPower), duration / (numJumps * 2)) + .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative() + .SetLoops(numJumps * 2, LoopType.Yoyo) + .OnStart(() => startPosY = target.position.y); + s.Append(DOTween.To(() => target.position, x => target.position = x, new Vector2(endValue.x, 0), duration) + .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) + ).Join(yTween) + .SetTarget(target).SetEase(DOTween.defaultEaseType); + yTween.OnUpdate(() => { + if (!offsetYSet) { + offsetYSet = true; + offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; + } + Vector3 pos = target.position; + pos.y += DOVirtual.EasedValue(0, offsetY, yTween.ElapsedPercentage(), Ease.OutQuad); + target.MovePosition(pos); + }); + return s; + } + + #endregion + + #endregion + + #endregion + } +} +#endif diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs.meta b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs.meta new file mode 100644 index 0000000..90a2548 --- /dev/null +++ b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModulePhysics2D.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e5f6736898055da4a92c520f0e872cc4 +timeCreated: 1571306506 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs new file mode 100644 index 0000000..549fff3 --- /dev/null +++ b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs @@ -0,0 +1,93 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2018/07/13 + +#if true && (UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER) // MODULE_MARKER +using System; +using UnityEngine; +using DG.Tweening.Core; +using DG.Tweening.Plugins.Options; + +#pragma warning disable 1591 +namespace DG.Tweening +{ + public static class DOTweenModuleSprite + { + #region Shortcuts + + #region SpriteRenderer + + /// Tweens a SpriteRenderer's color to the given value. + /// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static TweenerCore DOColor(this SpriteRenderer target, Color endValue, float duration) + { + TweenerCore t = DOTween.To(() => target.color, x => target.color = x, endValue, duration); + t.SetTarget(target); + return t; + } + + /// Tweens a Material's alpha color to the given value. + /// Also stores the spriteRenderer as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static TweenerCore DOFade(this SpriteRenderer target, float endValue, float duration) + { + TweenerCore t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration); + t.SetTarget(target); + return t; + } + + /// Tweens a SpriteRenderer's color using the given gradient + /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). + /// Also stores the image as the tween's target so it can be used for filtered operations + /// The gradient to useThe duration of the tween + public static Sequence DOGradientColor(this SpriteRenderer target, Gradient gradient, float duration) + { + Sequence s = DOTween.Sequence(); + GradientColorKey[] colors = gradient.colorKeys; + int len = colors.Length; + for (int i = 0; i < len; ++i) { + GradientColorKey c = colors[i]; + if (i == 0 && c.time <= 0) { + target.color = c.color; + continue; + } + float colorDuration = i == len - 1 + ? duration - s.Duration(false) // Verifies that total duration is correct + : duration * (i == 0 ? c.time : c.time - colors[i - 1].time); + s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear)); + } + s.SetTarget(target); + return s; + } + + #endregion + + #region Blendables + + #region SpriteRenderer + + /// Tweens a SpriteRenderer's color to the given value, + /// in a way that allows other DOBlendableColor tweens to work together on the same target, + /// instead than fight each other as multiple DOColor would do. + /// Also stores the SpriteRenderer as the tween's target so it can be used for filtered operations + /// The value to tween toThe duration of the tween + public static Tweener DOBlendableColor(this SpriteRenderer target, Color endValue, float duration) + { + endValue = endValue - target.color; + Color to = new Color(0, 0, 0, 0); + return DOTween.To(() => to, x => { + Color diff = x - to; + to = x; + target.color += diff; + }, endValue, duration) + .Blendable().SetTarget(target); + } + + #endregion + + #endregion + + #endregion + } +} +#endif diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs.meta b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs.meta new file mode 100644 index 0000000..16b8538 --- /dev/null +++ b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleSprite.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f5b5b3a415279844d88ddc9f4d926c68 +timeCreated: 1571306506 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUI.cs b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUI.cs new file mode 100644 index 0000000..6d45a04 --- /dev/null +++ b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUI.cs @@ -0,0 +1,609 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2018/07/13 + +#if true && (UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER) // MODULE_MARKER +using System; +using UnityEngine; +using UnityEngine.UI; +using DG.Tweening.Core; +using DG.Tweening.Core.Enums; +using DG.Tweening.Plugins.Options; + +#pragma warning disable 1591 +namespace DG.Tweening +{ + public static class DOTweenModuleUI + { + #region Shortcuts + + #region CanvasGroup + + /// Tweens a CanvasGroup's alpha color to the given value. + /// Also stores the canvasGroup as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static TweenerCore DOFade(this CanvasGroup target, float endValue, float duration) + { + TweenerCore t = DOTween.To(() => target.alpha, x => target.alpha = x, endValue, duration); + t.SetTarget(target); + return t; + } + + #endregion + + #region Graphic + + /// Tweens an Graphic's color to the given value. + /// Also stores the image as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static TweenerCore DOColor(this Graphic target, Color endValue, float duration) + { + TweenerCore t = DOTween.To(() => target.color, x => target.color = x, endValue, duration); + t.SetTarget(target); + return t; + } + + /// Tweens an Graphic's alpha color to the given value. + /// Also stores the image as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static TweenerCore DOFade(this Graphic target, float endValue, float duration) + { + TweenerCore t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration); + t.SetTarget(target); + return t; + } + + #endregion + + #region Image + + /// Tweens an Image's color to the given value. + /// Also stores the image as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static TweenerCore DOColor(this Image target, Color endValue, float duration) + { + TweenerCore t = DOTween.To(() => target.color, x => target.color = x, endValue, duration); + t.SetTarget(target); + return t; + } + + /// Tweens an Image's alpha color to the given value. + /// Also stores the image as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static TweenerCore DOFade(this Image target, float endValue, float duration) + { + TweenerCore t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration); + t.SetTarget(target); + return t; + } + + /// Tweens an Image's fillAmount to the given value. + /// Also stores the image as the tween's target so it can be used for filtered operations + /// The end value to reach (0 to 1)The duration of the tween + public static TweenerCore DOFillAmount(this Image target, float endValue, float duration) + { + if (endValue > 1) endValue = 1; + else if (endValue < 0) endValue = 0; + TweenerCore t = DOTween.To(() => target.fillAmount, x => target.fillAmount = x, endValue, duration); + t.SetTarget(target); + return t; + } + + /// Tweens an Image's colors using the given gradient + /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). + /// Also stores the image as the tween's target so it can be used for filtered operations + /// The gradient to useThe duration of the tween + public static Sequence DOGradientColor(this Image target, Gradient gradient, float duration) + { + Sequence s = DOTween.Sequence(); + GradientColorKey[] colors = gradient.colorKeys; + int len = colors.Length; + for (int i = 0; i < len; ++i) { + GradientColorKey c = colors[i]; + if (i == 0 && c.time <= 0) { + target.color = c.color; + continue; + } + float colorDuration = i == len - 1 + ? duration - s.Duration(false) // Verifies that total duration is correct + : duration * (i == 0 ? c.time : c.time - colors[i - 1].time); + s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear)); + } + s.SetTarget(target); + return s; + } + + #endregion + + #region LayoutElement + + /// Tweens an LayoutElement's flexibleWidth/Height to the given value. + /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOFlexibleSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => new Vector2(target.flexibleWidth, target.flexibleHeight), x => { + target.flexibleWidth = x.x; + target.flexibleHeight = x.y; + }, endValue, duration); + t.SetOptions(snapping).SetTarget(target); + return t; + } + + /// Tweens an LayoutElement's minWidth/Height to the given value. + /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOMinSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => new Vector2(target.minWidth, target.minHeight), x => { + target.minWidth = x.x; + target.minHeight = x.y; + }, endValue, duration); + t.SetOptions(snapping).SetTarget(target); + return t; + } + + /// Tweens an LayoutElement's preferredWidth/Height to the given value. + /// Also stores the LayoutElement as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOPreferredSize(this LayoutElement target, Vector2 endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => new Vector2(target.preferredWidth, target.preferredHeight), x => { + target.preferredWidth = x.x; + target.preferredHeight = x.y; + }, endValue, duration); + t.SetOptions(snapping).SetTarget(target); + return t; + } + + #endregion + + #region Outline + + /// Tweens a Outline's effectColor to the given value. + /// Also stores the Outline as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static TweenerCore DOColor(this Outline target, Color endValue, float duration) + { + TweenerCore t = DOTween.To(() => target.effectColor, x => target.effectColor = x, endValue, duration); + t.SetTarget(target); + return t; + } + + /// Tweens a Outline's effectColor alpha to the given value. + /// Also stores the Outline as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static TweenerCore DOFade(this Outline target, float endValue, float duration) + { + TweenerCore t = DOTween.ToAlpha(() => target.effectColor, x => target.effectColor = x, endValue, duration); + t.SetTarget(target); + return t; + } + + /// Tweens a Outline's effectDistance to the given value. + /// Also stores the Outline as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static TweenerCore DOScale(this Outline target, Vector2 endValue, float duration) + { + TweenerCore t = DOTween.To(() => target.effectDistance, x => target.effectDistance = x, endValue, duration); + t.SetTarget(target); + return t; + } + + #endregion + + #region RectTransform + + /// Tweens a RectTransform's anchoredPosition to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOAnchorPos(this RectTransform target, Vector2 endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, endValue, duration); + t.SetOptions(snapping).SetTarget(target); + return t; + } + /// Tweens a RectTransform's anchoredPosition X to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOAnchorPosX(this RectTransform target, float endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(endValue, 0), duration); + t.SetOptions(AxisConstraint.X, snapping).SetTarget(target); + return t; + } + /// Tweens a RectTransform's anchoredPosition Y to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOAnchorPosY(this RectTransform target, float endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(0, endValue), duration); + t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target); + return t; + } + + /// Tweens a RectTransform's anchoredPosition3D to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOAnchorPos3D(this RectTransform target, Vector3 endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, endValue, duration); + t.SetOptions(snapping).SetTarget(target); + return t; + } + /// Tweens a RectTransform's anchoredPosition3D X to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOAnchorPos3DX(this RectTransform target, float endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(endValue, 0, 0), duration); + t.SetOptions(AxisConstraint.X, snapping).SetTarget(target); + return t; + } + /// Tweens a RectTransform's anchoredPosition3D Y to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOAnchorPos3DY(this RectTransform target, float endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(0, endValue, 0), duration); + t.SetOptions(AxisConstraint.Y, snapping).SetTarget(target); + return t; + } + /// Tweens a RectTransform's anchoredPosition3D Z to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOAnchorPos3DZ(this RectTransform target, float endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.anchoredPosition3D, x => target.anchoredPosition3D = x, new Vector3(0, 0, endValue), duration); + t.SetOptions(AxisConstraint.Z, snapping).SetTarget(target); + return t; + } + + /// Tweens a RectTransform's anchorMax to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOAnchorMax(this RectTransform target, Vector2 endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.anchorMax, x => target.anchorMax = x, endValue, duration); + t.SetOptions(snapping).SetTarget(target); + return t; + } + + /// Tweens a RectTransform's anchorMin to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOAnchorMin(this RectTransform target, Vector2 endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.anchorMin, x => target.anchorMin = x, endValue, duration); + t.SetOptions(snapping).SetTarget(target); + return t; + } + + /// Tweens a RectTransform's pivot to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static TweenerCore DOPivot(this RectTransform target, Vector2 endValue, float duration) + { + TweenerCore t = DOTween.To(() => target.pivot, x => target.pivot = x, endValue, duration); + t.SetTarget(target); + return t; + } + /// Tweens a RectTransform's pivot X to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static TweenerCore DOPivotX(this RectTransform target, float endValue, float duration) + { + TweenerCore t = DOTween.To(() => target.pivot, x => target.pivot = x, new Vector2(endValue, 0), duration); + t.SetOptions(AxisConstraint.X).SetTarget(target); + return t; + } + /// Tweens a RectTransform's pivot Y to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static TweenerCore DOPivotY(this RectTransform target, float endValue, float duration) + { + TweenerCore t = DOTween.To(() => target.pivot, x => target.pivot = x, new Vector2(0, endValue), duration); + t.SetOptions(AxisConstraint.Y).SetTarget(target); + return t; + } + + /// Tweens a RectTransform's sizeDelta to the given value. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOSizeDelta(this RectTransform target, Vector2 endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.sizeDelta, x => target.sizeDelta = x, endValue, duration); + t.SetOptions(snapping).SetTarget(target); + return t; + } + + /// Punches a RectTransform's anchoredPosition towards the given direction and then back to the starting one + /// as if it was connected to the starting position via an elastic. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The direction and strength of the punch (added to the RectTransform's current position) + /// The duration of the tween + /// Indicates how much will the punch vibrate + /// Represents how much (0 to 1) the vector will go beyond the starting position when bouncing backwards. + /// 1 creates a full oscillation between the punch direction and the opposite direction, + /// while 0 oscillates only between the punch and the start position + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOPunchAnchorPos(this RectTransform target, Vector2 punch, float duration, int vibrato = 10, float elasticity = 1, bool snapping = false) + { + return DOTween.Punch(() => target.anchoredPosition, x => target.anchoredPosition = x, punch, duration, vibrato, elasticity) + .SetTarget(target).SetOptions(snapping); + } + + /// Shakes a RectTransform's anchoredPosition with the given values. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The duration of the tween + /// The shake strength + /// Indicates how much will the shake vibrate + /// Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). + /// Setting it to 0 will shake along a single direction. + /// If TRUE the tween will smoothly snap all values to integers + /// If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not + public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, float strength = 100, int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true) + { + return DOTween.Shake(() => target.anchoredPosition, x => target.anchoredPosition = x, duration, strength, vibrato, randomness, true, fadeOut) + .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping); + } + /// Shakes a RectTransform's anchoredPosition with the given values. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The duration of the tween + /// The shake strength on each axis + /// Indicates how much will the shake vibrate + /// Indicates how much the shake will be random (0 to 180 - values higher than 90 kind of suck, so beware). + /// Setting it to 0 will shake along a single direction. + /// If TRUE the tween will smoothly snap all values to integers + /// If TRUE the shake will automatically fadeOut smoothly within the tween's duration, otherwise it will not + public static Tweener DOShakeAnchorPos(this RectTransform target, float duration, Vector2 strength, int vibrato = 10, float randomness = 90, bool snapping = false, bool fadeOut = true) + { + return DOTween.Shake(() => target.anchoredPosition, x => target.anchoredPosition = x, duration, strength, vibrato, randomness, fadeOut) + .SetTarget(target).SetSpecialStartupMode(SpecialStartupMode.SetShake).SetOptions(snapping); + } + + #region Special + + /// Tweens a RectTransform's anchoredPosition to the given value, while also applying a jump effect along the Y axis. + /// Returns a Sequence instead of a Tweener. + /// Also stores the RectTransform as the tween's target so it can be used for filtered operations + /// The end value to reach + /// Power of the jump (the max height of the jump is represented by this plus the final Y offset) + /// Total number of jumps + /// The duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Sequence DOJumpAnchorPos(this RectTransform target, Vector2 endValue, float jumpPower, int numJumps, float duration, bool snapping = false) + { + if (numJumps < 1) numJumps = 1; + float startPosY = 0; + float offsetY = -1; + bool offsetYSet = false; + + // Separate Y Tween so we can elaborate elapsedPercentage on that insted of on the Sequence + // (in case users add a delay or other elements to the Sequence) + Sequence s = DOTween.Sequence(); + Tween yTween = DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(0, jumpPower), duration / (numJumps * 2)) + .SetOptions(AxisConstraint.Y, snapping).SetEase(Ease.OutQuad).SetRelative() + .SetLoops(numJumps * 2, LoopType.Yoyo) + .OnStart(()=> startPosY = target.anchoredPosition.y); + s.Append(DOTween.To(() => target.anchoredPosition, x => target.anchoredPosition = x, new Vector2(endValue.x, 0), duration) + .SetOptions(AxisConstraint.X, snapping).SetEase(Ease.Linear) + ).Join(yTween) + .SetTarget(target).SetEase(DOTween.defaultEaseType); + s.OnUpdate(() => { + if (!offsetYSet) { + offsetYSet = true; + offsetY = s.isRelative ? endValue.y : endValue.y - startPosY; + } + Vector2 pos = target.anchoredPosition; + pos.y += DOVirtual.EasedValue(0, offsetY, s.ElapsedDirectionalPercentage(), Ease.OutQuad); + target.anchoredPosition = pos; + }); + return s; + } + + #endregion + + #endregion + + #region ScrollRect + + /// Tweens a ScrollRect's horizontal/verticalNormalizedPosition to the given value. + /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DONormalizedPos(this ScrollRect target, Vector2 endValue, float duration, bool snapping = false) + { + return DOTween.To(() => new Vector2(target.horizontalNormalizedPosition, target.verticalNormalizedPosition), + x => { + target.horizontalNormalizedPosition = x.x; + target.verticalNormalizedPosition = x.y; + }, endValue, duration) + .SetOptions(snapping).SetTarget(target); + } + /// Tweens a ScrollRect's horizontalNormalizedPosition to the given value. + /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOHorizontalNormalizedPos(this ScrollRect target, float endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.horizontalNormalizedPosition, x => target.horizontalNormalizedPosition = x, endValue, duration) + .SetOptions(snapping).SetTarget(target); + } + /// Tweens a ScrollRect's verticalNormalizedPosition to the given value. + /// Also stores the ScrollRect as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static Tweener DOVerticalNormalizedPos(this ScrollRect target, float endValue, float duration, bool snapping = false) + { + return DOTween.To(() => target.verticalNormalizedPosition, x => target.verticalNormalizedPosition = x, endValue, duration) + .SetOptions(snapping).SetTarget(target); + } + + #endregion + + #region Slider + + /// Tweens a Slider's value to the given value. + /// Also stores the Slider as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + /// If TRUE the tween will smoothly snap all values to integers + public static TweenerCore DOValue(this Slider target, float endValue, float duration, bool snapping = false) + { + TweenerCore t = DOTween.To(() => target.value, x => target.value = x, endValue, duration); + t.SetOptions(snapping).SetTarget(target); + return t; + } + + #endregion + + #region Text + + /// Tweens a Text's color to the given value. + /// Also stores the Text as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static TweenerCore DOColor(this Text target, Color endValue, float duration) + { + TweenerCore t = DOTween.To(() => target.color, x => target.color = x, endValue, duration); + t.SetTarget(target); + return t; + } + + /// Tweens a Text's alpha color to the given value. + /// Also stores the Text as the tween's target so it can be used for filtered operations + /// The end value to reachThe duration of the tween + public static TweenerCore DOFade(this Text target, float endValue, float duration) + { + TweenerCore t = DOTween.ToAlpha(() => target.color, x => target.color = x, endValue, duration); + t.SetTarget(target); + return t; + } + + /// Tweens a Text's text to the given value. + /// Also stores the Text as the tween's target so it can be used for filtered operations + /// The end string to tween toThe duration of the tween + /// If TRUE (default), rich text will be interpreted correctly while animated, + /// otherwise all tags will be considered as normal text + /// The type of scramble mode to use, if any + /// A string containing the characters to use for scrambling. + /// Use as many characters as possible (minimum 10) because DOTween uses a fast scramble mode which gives better results with more characters. + /// Leave it to NULL (default) to use default ones + public static TweenerCore DOText(this Text target, string endValue, float duration, bool richTextEnabled = true, ScrambleMode scrambleMode = ScrambleMode.None, string scrambleChars = null) + { + if (endValue == null) { + if (Debugger.logPriority > 0) Debugger.LogWarning("You can't pass a NULL string to DOText: an empty string will be used instead to avoid errors"); + endValue = ""; + } + TweenerCore t = DOTween.To(() => target.text, x => target.text = x, endValue, duration); + t.SetOptions(richTextEnabled, scrambleMode, scrambleChars) + .SetTarget(target); + return t; + } + + #endregion + + #region Blendables + + #region Graphic + + /// Tweens a Graphic's color to the given value, + /// in a way that allows other DOBlendableColor tweens to work together on the same target, + /// instead than fight each other as multiple DOColor would do. + /// Also stores the Graphic as the tween's target so it can be used for filtered operations + /// The value to tween toThe duration of the tween + public static Tweener DOBlendableColor(this Graphic target, Color endValue, float duration) + { + endValue = endValue - target.color; + Color to = new Color(0, 0, 0, 0); + return DOTween.To(() => to, x => { + Color diff = x - to; + to = x; + target.color += diff; + }, endValue, duration) + .Blendable().SetTarget(target); + } + + #endregion + + #region Image + + /// Tweens a Image's color to the given value, + /// in a way that allows other DOBlendableColor tweens to work together on the same target, + /// instead than fight each other as multiple DOColor would do. + /// Also stores the Image as the tween's target so it can be used for filtered operations + /// The value to tween toThe duration of the tween + public static Tweener DOBlendableColor(this Image target, Color endValue, float duration) + { + endValue = endValue - target.color; + Color to = new Color(0, 0, 0, 0); + return DOTween.To(() => to, x => { + Color diff = x - to; + to = x; + target.color += diff; + }, endValue, duration) + .Blendable().SetTarget(target); + } + + #endregion + + #region Text + + /// Tweens a Text's color BY the given value, + /// in a way that allows other DOBlendableColor tweens to work together on the same target, + /// instead than fight each other as multiple DOColor would do. + /// Also stores the Text as the tween's target so it can be used for filtered operations + /// The value to tween toThe duration of the tween + public static Tweener DOBlendableColor(this Text target, Color endValue, float duration) + { + endValue = endValue - target.color; + Color to = new Color(0, 0, 0, 0); + return DOTween.To(() => to, x => { + Color diff = x - to; + to = x; + target.color += diff; + }, endValue, duration) + .Blendable().SetTarget(target); + } + + #endregion + + #endregion + + #endregion + + // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ + // ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████ + // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ + + public static class Utils + { + /// + /// Converts the anchoredPosition of the first RectTransform to the second RectTransform, + /// taking into consideration offset, anchors and pivot, and returns the new anchoredPosition + /// + public static Vector2 SwitchToRectTransform(RectTransform from, RectTransform to) + { + Vector2 localPoint; + Vector2 fromPivotDerivedOffset = new Vector2(from.rect.width * 0.5f + from.rect.xMin, from.rect.height * 0.5f + from.rect.yMin); + Vector2 screenP = RectTransformUtility.WorldToScreenPoint(null, from.position); + screenP += fromPivotDerivedOffset; + RectTransformUtility.ScreenPointToLocalPointInRectangle(to, screenP, null, out localPoint); + Vector2 pivotDerivedOffset = new Vector2(to.rect.width * 0.5f + to.rect.xMin, to.rect.height * 0.5f + to.rect.yMin); + return to.anchoredPosition + localPoint - pivotDerivedOffset; + } + } + } +} +#endif diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUI.cs.meta b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUI.cs.meta new file mode 100644 index 0000000..d064cac --- /dev/null +++ b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUI.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 046547dc007b98f459ad038a79356c4e +timeCreated: 1571306506 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs new file mode 100644 index 0000000..ce21262 --- /dev/null +++ b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs @@ -0,0 +1,301 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2018/07/13 + +using System; +using UnityEngine; +using DG.Tweening.Core; +using DG.Tweening.Plugins.Options; + +#pragma warning disable 1591 +namespace DG.Tweening +{ + /// + /// Shortcuts/functions that are not strictly related to specific Modules + /// but are available only on some Unity versions + /// + public static class DOTweenModuleUnityVersion + { +#if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1_OR_NEWER + #region Unity 4.3 or Newer + + #region Material + + /// Tweens a Material's color using the given gradient + /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). + /// Also stores the image as the tween's target so it can be used for filtered operations + /// The gradient to useThe duration of the tween + public static Sequence DOGradientColor(this Material target, Gradient gradient, float duration) + { + Sequence s = DOTween.Sequence(); + GradientColorKey[] colors = gradient.colorKeys; + int len = colors.Length; + for (int i = 0; i < len; ++i) { + GradientColorKey c = colors[i]; + if (i == 0 && c.time <= 0) { + target.color = c.color; + continue; + } + float colorDuration = i == len - 1 + ? duration - s.Duration(false) // Verifies that total duration is correct + : duration * (i == 0 ? c.time : c.time - colors[i - 1].time); + s.Append(target.DOColor(c.color, colorDuration).SetEase(Ease.Linear)); + } + s.SetTarget(target); + return s; + } + /// Tweens a Material's named color property using the given gradient + /// (NOTE 1: only uses the colors of the gradient, not the alphas - NOTE 2: creates a Sequence, not a Tweener). + /// Also stores the image as the tween's target so it can be used for filtered operations + /// The gradient to use + /// The name of the material property to tween (like _Tint or _SpecColor) + /// The duration of the tween + public static Sequence DOGradientColor(this Material target, Gradient gradient, string property, float duration) + { + Sequence s = DOTween.Sequence(); + GradientColorKey[] colors = gradient.colorKeys; + int len = colors.Length; + for (int i = 0; i < len; ++i) { + GradientColorKey c = colors[i]; + if (i == 0 && c.time <= 0) { + target.SetColor(property, 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)); + } + s.SetTarget(target); + return s; + } + + #endregion + + #endregion +#endif + +#if UNITY_5_3_OR_NEWER || UNITY_2017_1_OR_NEWER + #region Unity 5.3 or Newer + + #region CustomYieldInstructions + + /// + /// Returns a that waits until the tween is killed or complete. + /// It can be used inside a coroutine as a yield. + /// Example usage:yield return myTween.WaitForCompletion(true); + /// + public static CustomYieldInstruction WaitForCompletion(this Tween t, bool returnCustomYieldInstruction) + { + if (!t.active) { + if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); + return null; + } + return new DOTweenCYInstruction.WaitForCompletion(t); + } + + /// + /// Returns a that waits until the tween is killed or rewinded. + /// It can be used inside a coroutine as a yield. + /// Example usage:yield return myTween.WaitForRewind(); + /// + public static CustomYieldInstruction WaitForRewind(this Tween t, bool returnCustomYieldInstruction) + { + if (!t.active) { + if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); + return null; + } + return new DOTweenCYInstruction.WaitForRewind(t); + } + + /// + /// Returns a that waits until the tween is killed. + /// It can be used inside a coroutine as a yield. + /// Example usage:yield return myTween.WaitForKill(); + /// + public static CustomYieldInstruction WaitForKill(this Tween t, bool returnCustomYieldInstruction) + { + if (!t.active) { + if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); + return null; + } + return new DOTweenCYInstruction.WaitForKill(t); + } + + /// + /// Returns a that waits until the tween is killed or has gone through the given amount of loops. + /// It can be used inside a coroutine as a yield. + /// Example usage:yield return myTween.WaitForElapsedLoops(2); + /// + /// Elapsed loops to wait for + public static CustomYieldInstruction WaitForElapsedLoops(this Tween t, int elapsedLoops, bool returnCustomYieldInstruction) + { + if (!t.active) { + if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); + return null; + } + return new DOTweenCYInstruction.WaitForElapsedLoops(t, elapsedLoops); + } + + /// + /// Returns a that waits until the tween is killed or has reached the given position (loops included, delays excluded). + /// It can be used inside a coroutine as a yield. + /// Example usage:yield return myTween.WaitForPosition(2.5f); + /// + /// Position (loops included, delays excluded) to wait for + public static CustomYieldInstruction WaitForPosition(this Tween t, float position, bool returnCustomYieldInstruction) + { + if (!t.active) { + if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); + return null; + } + return new DOTweenCYInstruction.WaitForPosition(t, position); + } + + /// + /// Returns a that waits until the tween is killed or started + /// (meaning when the tween is set in a playing state the first time, after any eventual delay). + /// It can be used inside a coroutine as a yield. + /// Example usage:yield return myTween.WaitForStart(); + /// + public static CustomYieldInstruction WaitForStart(this Tween t, bool returnCustomYieldInstruction) + { + if (!t.active) { + if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t); + return null; + } + return new DOTweenCYInstruction.WaitForStart(t); + } + + #endregion + + #endregion +#endif + +#if UNITY_2018_1_OR_NEWER + #region Unity 2018.1 or Newer + + #region Material + + /// Tweens a Material's named texture offset property with the given ID to the given value. + /// Also stores the material as the tween's target so it can be used for filtered operations + /// The end value to reach + /// The ID of the material property to tween (also called nameID in Unity's manual) + /// The duration of the tween + public static TweenerCore DOOffset(this Material target, Vector2 endValue, int propertyID, float duration) + { + if (!target.HasProperty(propertyID)) { + if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(propertyID); + return null; + } + TweenerCore t = DOTween.To(() => target.GetTextureOffset(propertyID), x => target.SetTextureOffset(propertyID, x), endValue, duration); + t.SetTarget(target); + return t; + } + + /// Tweens a Material's named texture scale property with the given ID to the given value. + /// Also stores the material as the tween's target so it can be used for filtered operations + /// The end value to reach + /// The ID of the material property to tween (also called nameID in Unity's manual) + /// The duration of the tween + public static TweenerCore DOTiling(this Material target, Vector2 endValue, int propertyID, float duration) + { + if (!target.HasProperty(propertyID)) { + if (Debugger.logPriority > 0) Debugger.LogMissingMaterialProperty(propertyID); + return null; + } + TweenerCore t = DOTween.To(() => target.GetTextureScale(propertyID), x => target.SetTextureScale(propertyID, x), endValue, duration); + t.SetTarget(target); + return t; + } + + #endregion + + #endregion +#endif + } + + // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ + // ███ CLASSES █████████████████████████████████████████████████████████████████████████████████████████████████████████ + // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ + +#if UNITY_5_3_OR_NEWER || UNITY_2017_1_OR_NEWER + public static class DOTweenCYInstruction + { + public class WaitForCompletion : CustomYieldInstruction + { + public override bool keepWaiting { get { + return t.active && !t.IsComplete(); + }} + readonly Tween t; + public WaitForCompletion(Tween tween) + { + t = tween; + } + } + + public class WaitForRewind : CustomYieldInstruction + { + public override bool keepWaiting { get { + return t.active && (!t.playedOnce || t.position * (t.CompletedLoops() + 1) > 0); + }} + readonly Tween t; + public WaitForRewind(Tween tween) + { + t = tween; + } + } + + public class WaitForKill : CustomYieldInstruction + { + public override bool keepWaiting { get { + return t.active; + }} + readonly Tween t; + public WaitForKill(Tween tween) + { + t = tween; + } + } + + public class WaitForElapsedLoops : CustomYieldInstruction + { + public override bool keepWaiting { get { + return t.active && t.CompletedLoops() < elapsedLoops; + }} + readonly Tween t; + readonly int elapsedLoops; + public WaitForElapsedLoops(Tween tween, int elapsedLoops) + { + t = tween; + this.elapsedLoops = elapsedLoops; + } + } + + public class WaitForPosition : CustomYieldInstruction + { + public override bool keepWaiting { get { + return t.active && t.position * (t.CompletedLoops() + 1) < position; + }} + readonly Tween t; + readonly float position; + public WaitForPosition(Tween tween, float position) + { + t = tween; + this.position = position; + } + } + + public class WaitForStart : CustomYieldInstruction + { + public override bool keepWaiting { get { + return t.active && !t.playedOnce; + }} + readonly Tween t; + public WaitForStart(Tween tween) + { + t = tween; + } + } + } +#endif +} diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs.meta b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs.meta new file mode 100644 index 0000000..c4eb028 --- /dev/null +++ b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUnityVersion.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5b0fda71852649440aada8717daae3ed +timeCreated: 1571306506 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs new file mode 100644 index 0000000..8a1fb5f --- /dev/null +++ b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs @@ -0,0 +1,155 @@ +// Author: Daniele Giardini - http://www.demigiant.com +// Created: 2018/07/13 + +using System; +using System.Reflection; +using UnityEngine; +using DG.Tweening.Core; +using DG.Tweening.Plugins.Core.PathCore; +using DG.Tweening.Plugins.Options; + +#pragma warning disable 1591 +namespace DG.Tweening +{ + /// + /// Utility functions that deal with available Modules. + /// Modules defines: + /// - DOTAUDIO + /// - DOTPHYSICS + /// - DOTPHYSICS2D + /// - DOTSPRITE + /// - DOTUI + /// Extra defines set and used for implementation of external assets: + /// - DOTWEEN_TMP ► TextMesh Pro + /// - DOTWEEN_TK2D ► 2D Toolkit + /// + public static class DOTweenModuleUtils + { + static bool _initialized; + + #region Reflection + + /// + /// Called via Reflection by DOTweenComponent on Awake + /// +#if UNITY_2018_1_OR_NEWER + [UnityEngine.Scripting.Preserve] +#endif + public static void Init() + { + if (_initialized) return; + + _initialized = true; + DOTweenExternalCommand.SetOrientationOnPath += Physics.SetOrientationOnPath; + +#if UNITY_EDITOR +#if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1 + UnityEditor.EditorApplication.playmodeStateChanged += PlaymodeStateChanged; +#else + UnityEditor.EditorApplication.playModeStateChanged += PlaymodeStateChanged; +#endif +#endif + } + +#if UNITY_2018_1_OR_NEWER +#pragma warning disable + [UnityEngine.Scripting.Preserve] + // Just used to preserve methods when building, never called + static void Preserver() + { + Assembly[] loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies(); + MethodInfo mi = typeof(MonoBehaviour).GetMethod("Stub"); + } +#pragma warning restore +#endif + + #endregion + +#if UNITY_EDITOR + // Fires OnApplicationPause in DOTweenComponent even when Editor is paused (otherwise it's only fired at runtime) +#if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_2017_1 + static void PlaymodeStateChanged() + #else + static void PlaymodeStateChanged(UnityEditor.PlayModeStateChange state) +#endif + { + if (DOTween.instance == null) return; + DOTween.instance.OnApplicationPause(UnityEditor.EditorApplication.isPaused); + } +#endif + + // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ + // ███ INTERNAL CLASSES ████████████████████████████████████████████████████████████████████████████████████████████████ + // █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ + + public static class Physics + { + // Called via DOTweenExternalCommand callback + public static void SetOrientationOnPath(PathOptions options, Tween t, Quaternion newRot, Transform trans) + { +#if true // PHYSICS_MARKER + 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 true // PHYSICS2D_MARKER + return target.GetComponent() != null; +#else + return false; +#endif + } + + #region Called via Reflection + + + // Called via Reflection by DOTweenPathInspector + // Returns FALSE if the DOTween's Physics Module is disabled, or if there's no rigidbody attached +#if UNITY_2018_1_OR_NEWER + [UnityEngine.Scripting.Preserve] +#endif + public static bool HasRigidbody(Component target) + { +#if true // PHYSICS_MARKER + return target.GetComponent() != null; +#else + return false; +#endif + } + + // Called via Reflection by DOTweenPath +#if UNITY_2018_1_OR_NEWER + [UnityEngine.Scripting.Preserve] +#endif + public static TweenerCore CreateDOTweenPathTween( + MonoBehaviour target, bool tweenRigidbody, bool isLocal, Path path, float duration, PathMode pathMode + ){ + TweenerCore t; +#if true // PHYSICS_MARKER + Rigidbody rBody = tweenRigidbody ? target.GetComponent() : null; + if (tweenRigidbody && rBody != null) { + t = isLocal + ? rBody.DOLocalPath(path, duration, pathMode) + : rBody.DOPath(path, duration, pathMode); + } else { + t = isLocal + ? target.transform.DOLocalPath(path, duration, pathMode) + : target.transform.DOPath(path, duration, pathMode); + } +#else + t = isLocal + ? target.transform.DOLocalPath(path, duration, pathMode) + : target.transform.DOPath(path, duration, pathMode); +#endif + return t; + } + + #endregion + } + } +} diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs.meta b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs.meta new file mode 100644 index 0000000..9bdad71 --- /dev/null +++ b/UnityExamples.Unity5/Assets/Demigiant/DOTween/Modules/DOTweenModuleUtils.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 13102a7bb129af445aa4943ee333feb9 +timeCreated: 1571306506 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityExamples.Unity5/Assets/Demigiant/DOTween/readme.txt b/UnityExamples.Unity5/Assets/Demigiant/DOTween/readme.txt index 3439db1..37ff7ef 100644 --- a/UnityExamples.Unity5/Assets/Demigiant/DOTween/readme.txt +++ b/UnityExamples.Unity5/Assets/Demigiant/DOTween/readme.txt @@ -1,8 +1,18 @@ -DOTween and DOTween Pro are copyright (c) 2014 Daniele Giardini - Demigiant +DOTween and DOTween Pro are copyright (c) 2014-2018 Daniele Giardini - Demigiant + +// IMPORTANT!!! ///////////////////////////////////////////// +// Upgrading DOTween from versions older than 1.2.000 /////// +// (or DOTween Pro older than 1.0.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/deactivate Modules for Unity systems and for external assets (Pro version only) // GET STARTED ////////////////////////////////////////////// -- After importing a new DOTween update, select DOTween's Utility Panel from the Tools menu (if it doesn't open automatically) and press the "Setup DOTween..." button to set up additional features based on your Unity version. +- After importing a new DOTween update, select DOTween's Utility Panel from the "Tools/Demigiant" menu (if it doesn't open automatically) and press the "Setup DOTween..." button to activate/deactivate Modules. You can also access a Preferences Tab from there to choose default settings for DOTween. - In your code, add "using DG.Tweening" to each class where you want to use DOTween. - You're ready to tween. Check out the links below for full documentation and license info. @@ -12,7 +22,8 @@ DOTween and DOTween Pro are copyright (c) 2014 Daniele Giardini - Demigiant DOTween website (documentation, examples, etc): http://dotween.demigiant.com DOTween license: http://dotween.demigiant.com/license.php DOTween repository (Google Code): https://code.google.com/p/dotween/ +Demigiant website (documentation, examples, etc): http://www.demigiant.com // NOTES ////////////////////////////////////////////////////// -- DOTween's Utility Panel can be found under "Tools > DOTween Utility Panel" and also contains other useful options, plus a tab to set DOTween's preferences \ No newline at end of file +- DOTween's Utility Panel can be found under "Tools > Demigiant > DOTween Utility Panel" and also contains other useful options, plus a tab to set DOTween's preferences \ No newline at end of file diff --git a/UnityExamples.Unity5/Assets/Resources/DOTweenSettings.asset b/UnityExamples.Unity5/Assets/Resources/DOTweenSettings.asset index 8b59c7b..ee7cf63 100644 Binary files a/UnityExamples.Unity5/Assets/Resources/DOTweenSettings.asset and b/UnityExamples.Unity5/Assets/Resources/DOTweenSettings.asset differ diff --git a/UnityExamples.Unity5/ProjectSettings/ProjectSettings.asset b/UnityExamples.Unity5/ProjectSettings/ProjectSettings.asset index 97fd657..42fe4b8 100644 Binary files a/UnityExamples.Unity5/ProjectSettings/ProjectSettings.asset and b/UnityExamples.Unity5/ProjectSettings/ProjectSettings.asset differ diff --git a/UnityExamples.Unity5/ProjectSettings/ProjectVersion.txt b/UnityExamples.Unity5/ProjectSettings/ProjectVersion.txt index 558807b..7fcfffd 100644 --- a/UnityExamples.Unity5/ProjectSettings/ProjectVersion.txt +++ b/UnityExamples.Unity5/ProjectSettings/ProjectVersion.txt @@ -1,2 +1 @@ -m_EditorVersion: 5.3.5f1 -m_StandardAssetsVersion: 0 +m_EditorVersion: 5.6.5f1 diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll index 6484221..4735b66 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb index 46593ad..ecdfbad 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb and b/UnityTests.Unity5/Assets/Demigiant/DOTween/DOTween.dll.mdb differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll index b78b86d..44f2011 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll and b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb index 5ab8116..754ba18 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb and b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenEditor.dll.mdb differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll index b177fc3..2a108f7 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll and b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll.mdb b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll.mdb index 584b30f..44e1a31 100644 Binary files a/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll.mdb and b/UnityTests.Unity5/Assets/Demigiant/DOTween/Editor/DOTweenUpgradeManager.dll.mdb differ diff --git a/UnityTests.Unity5/Assets/Demigiant/DemiLib/Core/Editor/Imgs/whiteSquare.png.meta b/UnityTests.Unity5/Assets/Demigiant/DemiLib/Core/Editor/Imgs/whiteSquare.png.meta index 3dd4dd0..2f74ec1 100644 --- a/UnityTests.Unity5/Assets/Demigiant/DemiLib/Core/Editor/Imgs/whiteSquare.png.meta +++ b/UnityTests.Unity5/Assets/Demigiant/DemiLib/Core/Editor/Imgs/whiteSquare.png.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: d3e15b806a8368742ba6f10e794d7b76 -timeCreated: 1569668746 +timeCreated: 1571307125 licenseType: Pro TextureImporter: fileIDToRecycleName: {} diff --git a/_DOTween.Assembly/bin/DOTween.dll b/_DOTween.Assembly/bin/DOTween.dll index 6484221..4735b66 100644 Binary files a/_DOTween.Assembly/bin/DOTween.dll and b/_DOTween.Assembly/bin/DOTween.dll differ diff --git a/_DOTween.Assembly/bin/DOTween.dll.mdb b/_DOTween.Assembly/bin/DOTween.dll.mdb index 46593ad..ecdfbad 100644 Binary files a/_DOTween.Assembly/bin/DOTween.dll.mdb and b/_DOTween.Assembly/bin/DOTween.dll.mdb differ diff --git a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll index b78b86d..44f2011 100644 Binary files a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll and b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll differ diff --git a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb index 5ab8116..754ba18 100644 Binary files a/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb and b/_DOTween.Assembly/bin/Editor/DOTweenEditor.dll.mdb differ diff --git a/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll b/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll index b177fc3..2a108f7 100644 Binary files a/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll and b/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll differ diff --git a/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll.mdb b/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll.mdb index 584b30f..44e1a31 100644 Binary files a/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll.mdb and b/_DOTween.Assembly/bin/Editor/DOTweenUpgradeManager.dll.mdb differ