mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2025-12-20 09:16:02 +08:00
Added SmoothRewind/SmoothRewindAll/DOSmoothRewind control methods
This commit is contained in:
parent
f73c8454a0
commit
bfe4a350a0
@ -676,9 +676,16 @@
|
||||
<param name="includeDelay">If TRUE includes the eventual tween delay, otherwise skips it</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenExtensions.Rewind(DG.Tweening.Tween,System.Boolean)">
|
||||
<summary>Rewinds the tween</summary>
|
||||
<summary>Rewinds and pauses the tween</summary>
|
||||
<param name="includeDelay">If TRUE includes the eventual tween delay, otherwise skips it</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenExtensions.SmoothRewind(DG.Tweening.Tween)">
|
||||
<summary>Smoothly rewinds the tween (delays excluded).
|
||||
A "smooth rewind" animates the tween to its start position,
|
||||
skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent.
|
||||
If called on a tween who is still waiting for its delay to happen, it will simply set the delay to 0 and pause the tween.
|
||||
<para>Note that a tween that was smoothly rewinded will have its play direction flipped</para></summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenExtensions.TogglePause(DG.Tweening.Tween)">
|
||||
<summary>Plays the tween if it was paused, pauses it if it was playing</summary>
|
||||
</member>
|
||||
@ -1443,6 +1450,13 @@
|
||||
and returns the total number of tweens rewinded.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOSmoothRewind(UnityEngine.Component)">
|
||||
<summary>
|
||||
Smoothly eewinds all tweens that have this target as a reference
|
||||
(meaning tweens that were started from this target, or that had this target added as an Id)
|
||||
and returns the total number of tweens rewinded.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOTogglePause(UnityEngine.Component)">
|
||||
<summary>
|
||||
Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
|
||||
@ -1892,6 +1906,20 @@
|
||||
<summary>Rewinds and pauses all tweens with the given ID or target, then returns the number of actual tweens rewinded
|
||||
(meaning the tweens that were not already rewinded)</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.SmoothRewindAll">
|
||||
<summary>Smoothly rewinds all tweens (delays excluded), then returns the number of actual tweens rewinding/rewinded
|
||||
(meaning tweens that were not already rewinded).
|
||||
A "smooth rewind" animates the tween to its start position,
|
||||
skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent.
|
||||
<para>Note that a tween that was smoothly rewinded will have its play direction flipped</para></summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.SmoothRewind(System.Object)">
|
||||
<summary>Smoothly rewinds all tweens (delays excluded) with the given ID or target, then returns the number of actual tweens rewinding/rewinded
|
||||
(meaning the tweens that were not already rewinded).
|
||||
A "smooth rewind" animates the tween to its start position,
|
||||
skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent.
|
||||
<para>Note that a tween that was smoothly rewinded will have its play direction flipped</para></summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.TogglePauseAll">
|
||||
<summary>Toggles the play state of all tweens and returns the number of actual tweens toggled
|
||||
(meaning tweens that could be played or paused, depending on the toggle state)</summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -92,6 +92,13 @@
|
||||
and returns the total number of tweens rewinded.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions50.DOSmoothRewind(UnityEngine.Audio.AudioMixer)">
|
||||
<summary>
|
||||
Smoothly eewinds all tweens that have this target as a reference
|
||||
(meaning tweens that were started from this target, or that had this target added as an Id)
|
||||
and returns the total number of tweens rewinded.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions50.DOTogglePause(UnityEngine.Audio.AudioMixer)">
|
||||
<summary>
|
||||
Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -676,9 +676,16 @@
|
||||
<param name="includeDelay">If TRUE includes the eventual tween delay, otherwise skips it</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenExtensions.Rewind(DG.Tweening.Tween,System.Boolean)">
|
||||
<summary>Rewinds the tween</summary>
|
||||
<summary>Rewinds and pauses the tween</summary>
|
||||
<param name="includeDelay">If TRUE includes the eventual tween delay, otherwise skips it</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenExtensions.SmoothRewind(DG.Tweening.Tween)">
|
||||
<summary>Smoothly rewinds the tween (delays excluded).
|
||||
A "smooth rewind" animates the tween to its start position,
|
||||
skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent.
|
||||
If called on a tween who is still waiting for its delay to happen, it will simply set the delay to 0 and pause the tween.
|
||||
<para>Note that a tween that was smoothly rewinded will have its play direction flipped</para></summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenExtensions.TogglePause(DG.Tweening.Tween)">
|
||||
<summary>Plays the tween if it was paused, pauses it if it was playing</summary>
|
||||
</member>
|
||||
@ -1443,6 +1450,13 @@
|
||||
and returns the total number of tweens rewinded.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOSmoothRewind(UnityEngine.Component)">
|
||||
<summary>
|
||||
Smoothly eewinds all tweens that have this target as a reference
|
||||
(meaning tweens that were started from this target, or that had this target added as an Id)
|
||||
and returns the total number of tweens rewinded.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOTogglePause(UnityEngine.Component)">
|
||||
<summary>
|
||||
Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
|
||||
@ -1892,6 +1906,20 @@
|
||||
<summary>Rewinds and pauses all tweens with the given ID or target, then returns the number of actual tweens rewinded
|
||||
(meaning the tweens that were not already rewinded)</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.SmoothRewindAll">
|
||||
<summary>Smoothly rewinds all tweens (delays excluded), then returns the number of actual tweens rewinding/rewinded
|
||||
(meaning tweens that were not already rewinded).
|
||||
A "smooth rewind" animates the tween to its start position,
|
||||
skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent.
|
||||
<para>Note that a tween that was smoothly rewinded will have its play direction flipped</para></summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.SmoothRewind(System.Object)">
|
||||
<summary>Smoothly rewinds all tweens (delays excluded) with the given ID or target, then returns the number of actual tweens rewinding/rewinded
|
||||
(meaning the tweens that were not already rewinded).
|
||||
A "smooth rewind" animates the tween to its start position,
|
||||
skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent.
|
||||
<para>Note that a tween that was smoothly rewinded will have its play direction flipped</para></summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.TogglePauseAll">
|
||||
<summary>Toggles the play state of all tweens and returns the number of actual tweens toggled
|
||||
(meaning tweens that could be played or paused, depending on the toggle state)</summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -92,6 +92,13 @@
|
||||
and returns the total number of tweens rewinded.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions50.DOSmoothRewind(UnityEngine.Audio.AudioMixer)">
|
||||
<summary>
|
||||
Smoothly eewinds all tweens that have this target as a reference
|
||||
(meaning tweens that were started from this target, or that had this target added as an Id)
|
||||
and returns the total number of tweens rewinded.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions50.DOTogglePause(UnityEngine.Audio.AudioMixer)">
|
||||
<summary>
|
||||
Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -676,9 +676,16 @@
|
||||
<param name="includeDelay">If TRUE includes the eventual tween delay, otherwise skips it</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenExtensions.Rewind(DG.Tweening.Tween,System.Boolean)">
|
||||
<summary>Rewinds the tween</summary>
|
||||
<summary>Rewinds and pauses the tween</summary>
|
||||
<param name="includeDelay">If TRUE includes the eventual tween delay, otherwise skips it</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenExtensions.SmoothRewind(DG.Tweening.Tween)">
|
||||
<summary>Smoothly rewinds the tween (delays excluded).
|
||||
A "smooth rewind" animates the tween to its start position,
|
||||
skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent.
|
||||
If called on a tween who is still waiting for its delay to happen, it will simply set the delay to 0 and pause the tween.
|
||||
<para>Note that a tween that was smoothly rewinded will have its play direction flipped</para></summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenExtensions.TogglePause(DG.Tweening.Tween)">
|
||||
<summary>Plays the tween if it was paused, pauses it if it was playing</summary>
|
||||
</member>
|
||||
@ -1443,6 +1450,13 @@
|
||||
and returns the total number of tweens rewinded.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOSmoothRewind(UnityEngine.Component)">
|
||||
<summary>
|
||||
Smoothly eewinds all tweens that have this target as a reference
|
||||
(meaning tweens that were started from this target, or that had this target added as an Id)
|
||||
and returns the total number of tweens rewinded.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOTogglePause(UnityEngine.Component)">
|
||||
<summary>
|
||||
Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
|
||||
@ -1892,6 +1906,20 @@
|
||||
<summary>Rewinds and pauses all tweens with the given ID or target, then returns the number of actual tweens rewinded
|
||||
(meaning the tweens that were not already rewinded)</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.SmoothRewindAll">
|
||||
<summary>Smoothly rewinds all tweens (delays excluded), then returns the number of actual tweens rewinding/rewinded
|
||||
(meaning tweens that were not already rewinded).
|
||||
A "smooth rewind" animates the tween to its start position,
|
||||
skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent.
|
||||
<para>Note that a tween that was smoothly rewinded will have its play direction flipped</para></summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.SmoothRewind(System.Object)">
|
||||
<summary>Smoothly rewinds all tweens (delays excluded) with the given ID or target, then returns the number of actual tweens rewinding/rewinded
|
||||
(meaning the tweens that were not already rewinded).
|
||||
A "smooth rewind" animates the tween to its start position,
|
||||
skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent.
|
||||
<para>Note that a tween that was smoothly rewinded will have its play direction flipped</para></summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.TogglePauseAll">
|
||||
<summary>Toggles the play state of all tweens and returns the number of actual tweens toggled
|
||||
(meaning tweens that could be played or paused, depending on the toggle state)</summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -92,6 +92,13 @@
|
||||
and returns the total number of tweens rewinded.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions50.DOSmoothRewind(UnityEngine.Audio.AudioMixer)">
|
||||
<summary>
|
||||
Smoothly eewinds all tweens that have this target as a reference
|
||||
(meaning tweens that were started from this target, or that had this target added as an Id)
|
||||
and returns the total number of tweens rewinded.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions50.DOTogglePause(UnityEngine.Audio.AudioMixer)">
|
||||
<summary>
|
||||
Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
29
UnityTests.Unity5/Assets/_DOTween Examples/FadeActive.cs
Normal file
29
UnityTests.Unity5/Assets/_DOTween Examples/FadeActive.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using DG.Tweening;
|
||||
|
||||
public class FadeActive : MonoBehaviour
|
||||
{
|
||||
public SpriteRenderer[] fadeTargets;
|
||||
Sequence fadeTween;
|
||||
|
||||
void Start()
|
||||
{
|
||||
fadeTween = DOTween.Sequence().SetAutoKill(false).Pause();
|
||||
foreach (SpriteRenderer r in fadeTargets) fadeTween.Append(r.DOFade(0, 1));
|
||||
fadeTween.OnComplete(()=> {
|
||||
foreach (SpriteRenderer r in fadeTargets) r.gameObject.SetActive(false);
|
||||
});
|
||||
}
|
||||
|
||||
public void FadeOut()
|
||||
{
|
||||
fadeTween.PlayForward();
|
||||
}
|
||||
|
||||
public void FadeIn()
|
||||
{
|
||||
foreach (SpriteRenderer r in fadeTargets) r.gameObject.SetActive(true);
|
||||
fadeTween.PlayBackwards();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0bdadf194ef79a341b3ab40a750ce7a3
|
||||
timeCreated: 1433095869
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
UnityTests.Unity5/Assets/_DOTween Examples/FadeActive.unity
Normal file
BIN
UnityTests.Unity5/Assets/_DOTween Examples/FadeActive.unity
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a115d6ceab834ce4194b0cbbb8cd6724
|
||||
timeCreated: 1433095862
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,36 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using DG.Tweening;
|
||||
|
||||
public class InfinitePulseAndSmoothHover : MonoBehaviour
|
||||
{
|
||||
Tween pulseTween;
|
||||
|
||||
void Start()
|
||||
{
|
||||
// Create the pulse tween and pause it
|
||||
pulseTween = this.transform.DOScale(1.3f, 0.5f)
|
||||
.SetEase(Ease.InOutQuad)
|
||||
.SetLoops(-1, LoopType.Yoyo)
|
||||
.Pause();
|
||||
}
|
||||
|
||||
void OnMouseEnter()
|
||||
{
|
||||
// Just play forward
|
||||
pulseTween.PlayForward();
|
||||
}
|
||||
|
||||
void OnMouseExit()
|
||||
{
|
||||
// Find the current elapsed duration without considering loops,
|
||||
// then goto it and play the tween backwards.
|
||||
// I'm gonna use ElapsedDirectionalPercentage instead of Elapsed,
|
||||
// because I want Yoyo loops to be considered correctly inverted as they are
|
||||
// pulseTween.Goto(pulseTween.ElapsedDirectionalPercentage() * pulseTween.Duration(false));
|
||||
// pulseTween.PlayBackwards();
|
||||
|
||||
// That said, I just added a SmoothRewind method so you can use that :P
|
||||
pulseTween.SmoothRewind();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc3c938e60e99be4f85f713e011ffa41
|
||||
timeCreated: 1433260532
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 46905253108a53046805065f19cff1ba
|
||||
timeCreated: 1433260432
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
UnityTests.Unity5/Assets/_DOTween Examples/Spaceship.png
Normal file
BIN
UnityTests.Unity5/Assets/_DOTween Examples/Spaceship.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
@ -0,0 +1,55 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 48a2d12d750f2db42a41f7bdc0935848
|
||||
timeCreated: 1433096829
|
||||
licenseType: Free
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -3
|
||||
maxTextureSize: 256
|
||||
textureSettings:
|
||||
filterMode: 1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 1
|
||||
textureType: 8
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
Before Width: | Height: | Size: 248 KiB After Width: | Height: | Size: 248 KiB |
9
UnityTests.Unity5/Assets/_DOTween Pro Examples.meta
Normal file
9
UnityTests.Unity5/Assets/_DOTween Pro Examples.meta
Normal file
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9768ed5098c764340993b77c5041f760
|
||||
folderAsset: yes
|
||||
timeCreated: 1433154581
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
UnityTests.Unity5/Assets/_DOTween Pro Examples/MAT Sword A.mat
Normal file
BIN
UnityTests.Unity5/Assets/_DOTween Pro Examples/MAT Sword A.mat
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 21910083fa7ddb9418b1f325411856be
|
||||
timeCreated: 1433157219
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
UnityTests.Unity5/Assets/_DOTween Pro Examples/MAT Sword B.mat
Normal file
BIN
UnityTests.Unity5/Assets/_DOTween Pro Examples/MAT Sword B.mat
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c9c1c8b84aaadd843ab6ebf98bdd8b71
|
||||
timeCreated: 1433157312
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 908059918c3382a4fa594291928bae25
|
||||
timeCreated: 1433154602
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@ -7,40 +7,27 @@ using DG.Tweening.Core;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class TempTests : BrainBase
|
||||
public class TempTests : MonoBehaviour
|
||||
{
|
||||
public Transform targetA, targetB;
|
||||
Sequence sequence;
|
||||
|
||||
public DOGetter<Vector3> getterA, getterB;
|
||||
|
||||
IEnumerator Start()
|
||||
void Start()
|
||||
{
|
||||
yield return new WaitForSeconds(1);
|
||||
sequence = DOTween.Sequence();
|
||||
sequence.AppendInterval(3);
|
||||
sequence.AppendCallback(() => {
|
||||
this.transform.GetComponent<MeshRenderer>().enabled = !this.transform.GetComponent<MeshRenderer>().enabled;
|
||||
});
|
||||
|
||||
getterA = ()=> targetA.position;
|
||||
getterB = ()=> targetB.position;
|
||||
|
||||
Debug.Log(getterA == getterB);
|
||||
Debug.Log(getterA.Equals(getterB));
|
||||
|
||||
float time = Time.realtimeSinceStartup;
|
||||
Debug.Log(CompareGetters(getterA, getterB));
|
||||
float elapsed = Time.realtimeSinceStartup - time;
|
||||
Debug.Log("Compare executed in " + elapsed + " seconds");
|
||||
sequence.SetLoops(-1, LoopType.Restart);
|
||||
sequence.Play();
|
||||
}
|
||||
|
||||
bool CompareGetters<T>(DOGetter<T> a, DOGetter<T> b)
|
||||
{
|
||||
var aBody = a.Method.GetMethodBody().GetILAsByteArray();
|
||||
var bBody = b.Method.GetMethodBody().GetILAsByteArray();
|
||||
|
||||
int aLen = aBody.Length;
|
||||
Debug.Log("LEN: " + aLen);
|
||||
if (aLen != bBody.Length) return false;
|
||||
|
||||
for(int i = 0; i < aLen; i++) {
|
||||
if(aBody[i] != bBody[i]) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
void OnDestroy()
|
||||
{
|
||||
if (sequence != null) {
|
||||
Debug.Log("Killing Sequence");
|
||||
sequence.Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@ -17,6 +17,7 @@ namespace DG.Tweening.Core.Enums
|
||||
PlayForward,
|
||||
PlayBackwards,
|
||||
Rewind,
|
||||
SmoothRewind,
|
||||
Restart,
|
||||
TogglePause,
|
||||
IsTweening
|
||||
|
||||
@ -474,6 +474,9 @@ namespace DG.Tweening.Core
|
||||
case OperationType.Rewind:
|
||||
if (Rewind(t, optionalBool)) totInvolved++;
|
||||
break;
|
||||
case OperationType.SmoothRewind:
|
||||
if (SmoothRewind(t)) totInvolved++;
|
||||
break;
|
||||
case OperationType.TogglePause:
|
||||
if (TogglePause(t)) totInvolved++;
|
||||
break;
|
||||
@ -634,6 +637,25 @@ namespace DG.Tweening.Core
|
||||
return rewinded;
|
||||
}
|
||||
|
||||
internal static bool SmoothRewind(Tween t)
|
||||
{
|
||||
bool rewinded = false;
|
||||
if (t.delay > 0) {
|
||||
rewinded = t.elapsedDelay < t.delay;
|
||||
t.elapsedDelay = t.delay;
|
||||
t.delayComplete = true;
|
||||
}
|
||||
if (t.position > 0 || t.completedLoops > 0 || !t.startupDone) {
|
||||
rewinded = true;
|
||||
if (t.loopType == LoopType.Incremental) t.PlayBackwards();
|
||||
else {
|
||||
t.Goto(t.ElapsedDirectionalPercentage() * t.duration);
|
||||
t.PlayBackwards();
|
||||
}
|
||||
} else t.isPlaying = false;
|
||||
return rewinded;
|
||||
}
|
||||
|
||||
internal static bool TogglePause(Tween t)
|
||||
{
|
||||
if (t.isPlaying) return Pause(t);
|
||||
|
||||
@ -32,7 +32,7 @@ namespace DG.Tweening
|
||||
public class DOTween
|
||||
{
|
||||
/// <summary>DOTween's version</summary>
|
||||
public static readonly string Version = "1.0.765";
|
||||
public static readonly string Version = "1.0.770";
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// Options ////////////////////////////////////
|
||||
@ -791,6 +791,26 @@ namespace DG.Tweening
|
||||
return TweenManager.FilteredOperation(OperationType.Rewind, FilterType.TargetOrId, targetOrId, includeDelay, 0);
|
||||
}
|
||||
|
||||
/// <summary>Smoothly rewinds all tweens (delays excluded), then returns the number of actual tweens rewinding/rewinded
|
||||
/// (meaning tweens that were not already rewinded).
|
||||
/// A "smooth rewind" animates the tween to its start position,
|
||||
/// skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent.
|
||||
/// <para>Note that a tween that was smoothly rewinded will have its play direction flipped</para></summary>
|
||||
public static int SmoothRewindAll()
|
||||
{
|
||||
return TweenManager.FilteredOperation(OperationType.SmoothRewind, FilterType.All, null, false, 0);
|
||||
}
|
||||
/// <summary>Smoothly rewinds all tweens (delays excluded) with the given ID or target, then returns the number of actual tweens rewinding/rewinded
|
||||
/// (meaning the tweens that were not already rewinded).
|
||||
/// A "smooth rewind" animates the tween to its start position,
|
||||
/// skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent.
|
||||
/// <para>Note that a tween that was smoothly rewinded will have its play direction flipped</para></summary>
|
||||
public static int SmoothRewind(object targetOrId)
|
||||
{
|
||||
if (targetOrId == null) return 0;
|
||||
return TweenManager.FilteredOperation(OperationType.SmoothRewind, FilterType.TargetOrId, targetOrId, false, 0);
|
||||
}
|
||||
|
||||
/// <summary>Toggles the play state of all tweens and returns the number of actual tweens toggled
|
||||
/// (meaning tweens that could be played or paused, depending on the toggle state)</summary>
|
||||
public static int TogglePauseAll()
|
||||
|
||||
@ -1215,6 +1215,16 @@ namespace DG.Tweening
|
||||
return DOTween.Rewind(target, includeDelay);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Smoothly rewinds all tweens that have this target as a reference
|
||||
/// (meaning tweens that were started from this target, or that had this target added as an Id)
|
||||
/// and returns the total number of tweens rewinded.
|
||||
/// </summary>
|
||||
public static int DOSmoothRewind(this Component target)
|
||||
{
|
||||
return DOTween.SmoothRewind(target);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
|
||||
/// (meaning tweens that were started from this target, or that had this target added as an Id)
|
||||
|
||||
@ -179,7 +179,7 @@ namespace DG.Tweening
|
||||
TweenManager.Restart(t, includeDelay);
|
||||
}
|
||||
|
||||
/// <summary>Rewinds the tween</summary>
|
||||
/// <summary>Rewinds and pauses the tween</summary>
|
||||
/// <param name="includeDelay">If TRUE includes the eventual tween delay, otherwise skips it</param>
|
||||
public static void Rewind(this Tween t, bool includeDelay = true)
|
||||
{
|
||||
@ -194,6 +194,24 @@ namespace DG.Tweening
|
||||
TweenManager.Rewind(t, includeDelay);
|
||||
}
|
||||
|
||||
/// <summary>Smoothly rewinds the tween (delays excluded).
|
||||
/// A "smooth rewind" animates the tween to its start position,
|
||||
/// skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent.
|
||||
/// If called on a tween who is still waiting for its delay to happen, it will simply set the delay to 0 and pause the tween.
|
||||
/// <para>Note that a tween that was smoothly rewinded will have its play direction flipped</para></summary>
|
||||
public static void SmoothRewind(this Tween t)
|
||||
{
|
||||
if (t == null) {
|
||||
if (Debugger.logPriority > 1) Debugger.LogNullTween(t); return;
|
||||
} else if (!t.active) {
|
||||
if (Debugger.logPriority > 1) Debugger.LogInvalidTween(t); return;
|
||||
} else if (t.isSequenced) {
|
||||
if (Debugger.logPriority > 1) Debugger.LogNestedTween(t); return;
|
||||
}
|
||||
|
||||
TweenManager.SmoothRewind(t);
|
||||
}
|
||||
|
||||
/// <summary>Plays the tween if it was paused, pauses it if it was playing</summary>
|
||||
public static void TogglePause(this Tween t)
|
||||
{
|
||||
|
||||
@ -126,7 +126,7 @@ namespace DG.Tweening
|
||||
/// </summary>
|
||||
public static int DORestart(this AudioMixer target)
|
||||
{
|
||||
return DOTween.RestartAll(target);
|
||||
return DOTween.Restart(target);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -136,7 +136,17 @@ namespace DG.Tweening
|
||||
/// </summary>
|
||||
public static int DORewind(this AudioMixer target)
|
||||
{
|
||||
return DOTween.RewindAll(target);
|
||||
return DOTween.Rewind(target);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Smoothly rewinds all tweens that have this target as a reference
|
||||
/// (meaning tweens that were started from this target, or that had this target added as an Id)
|
||||
/// and returns the total number of tweens rewinded.
|
||||
/// </summary>
|
||||
public static int DOSmoothRewind(this AudioMixer target)
|
||||
{
|
||||
return DOTween.SmoothRewind(target);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -676,9 +676,16 @@
|
||||
<param name="includeDelay">If TRUE includes the eventual tween delay, otherwise skips it</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenExtensions.Rewind(DG.Tweening.Tween,System.Boolean)">
|
||||
<summary>Rewinds the tween</summary>
|
||||
<summary>Rewinds and pauses the tween</summary>
|
||||
<param name="includeDelay">If TRUE includes the eventual tween delay, otherwise skips it</param>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenExtensions.SmoothRewind(DG.Tweening.Tween)">
|
||||
<summary>Smoothly rewinds the tween (delays excluded).
|
||||
A "smooth rewind" animates the tween to its start position,
|
||||
skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent.
|
||||
If called on a tween who is still waiting for its delay to happen, it will simply set the delay to 0 and pause the tween.
|
||||
<para>Note that a tween that was smoothly rewinded will have its play direction flipped</para></summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.TweenExtensions.TogglePause(DG.Tweening.Tween)">
|
||||
<summary>Plays the tween if it was paused, pauses it if it was playing</summary>
|
||||
</member>
|
||||
@ -1443,6 +1450,13 @@
|
||||
and returns the total number of tweens rewinded.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOSmoothRewind(UnityEngine.Component)">
|
||||
<summary>
|
||||
Smoothly eewinds all tweens that have this target as a reference
|
||||
(meaning tweens that were started from this target, or that had this target added as an Id)
|
||||
and returns the total number of tweens rewinded.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions.DOTogglePause(UnityEngine.Component)">
|
||||
<summary>
|
||||
Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
|
||||
@ -1892,6 +1906,20 @@
|
||||
<summary>Rewinds and pauses all tweens with the given ID or target, then returns the number of actual tweens rewinded
|
||||
(meaning the tweens that were not already rewinded)</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.SmoothRewindAll">
|
||||
<summary>Smoothly rewinds all tweens (delays excluded), then returns the number of actual tweens rewinding/rewinded
|
||||
(meaning tweens that were not already rewinded).
|
||||
A "smooth rewind" animates the tween to its start position,
|
||||
skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent.
|
||||
<para>Note that a tween that was smoothly rewinded will have its play direction flipped</para></summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.SmoothRewind(System.Object)">
|
||||
<summary>Smoothly rewinds all tweens (delays excluded) with the given ID or target, then returns the number of actual tweens rewinding/rewinded
|
||||
(meaning the tweens that were not already rewinded).
|
||||
A "smooth rewind" animates the tween to its start position,
|
||||
skipping all elapsed loops (except in case of LoopType.Incremental) while keeping the animation fluent.
|
||||
<para>Note that a tween that was smoothly rewinded will have its play direction flipped</para></summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.DOTween.TogglePauseAll">
|
||||
<summary>Toggles the play state of all tweens and returns the number of actual tweens toggled
|
||||
(meaning tweens that could be played or paused, depending on the toggle state)</summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -92,6 +92,13 @@
|
||||
and returns the total number of tweens rewinded.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions50.DOSmoothRewind(UnityEngine.Audio.AudioMixer)">
|
||||
<summary>
|
||||
Smoothly eewinds all tweens that have this target as a reference
|
||||
(meaning tweens that were started from this target, or that had this target added as an Id)
|
||||
and returns the total number of tweens rewinded.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:DG.Tweening.ShortcutExtensions50.DOTogglePause(UnityEngine.Audio.AudioMixer)">
|
||||
<summary>
|
||||
Toggles the paused state (plays if it was paused, pauses if it was playing) of all tweens that have this target as a reference
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user