1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2026-02-15 03:21:37 +08:00

Added tween.Loops() method

This commit is contained in:
Daniele Giardini 2015-06-08 16:50:18 +02:00
parent a1eedfa14e
commit 5c9a7e4fd3
63 changed files with 140 additions and 5 deletions

View File

@ -790,6 +790,10 @@
<member name="M:DG.Tweening.TweenExtensions.IsPlaying(DG.Tweening.Tween)"> <member name="M:DG.Tweening.TweenExtensions.IsPlaying(DG.Tweening.Tween)">
<summary>Returns TRUE if this tween is playing</summary> <summary>Returns TRUE if this tween is playing</summary>
</member> </member>
<member name="M:DG.Tweening.TweenExtensions.Loops(DG.Tweening.Tween)">
<summary>Returns the total number of loops set for this tween
(returns -1 if the loops are infinite)</summary>
</member>
<member name="M:DG.Tweening.TweenExtensions.PathGetPoint(DG.Tweening.Tween,System.Single)"> <member name="M:DG.Tweening.TweenExtensions.PathGetPoint(DG.Tweening.Tween,System.Single)">
<summary> <summary>
Returns a point on a path based on the given path percentage. Returns a point on a path based on the given path percentage.

View File

@ -94,7 +94,7 @@
</member> </member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOSmoothRewind(UnityEngine.Audio.AudioMixer)"> <member name="M:DG.Tweening.ShortcutExtensions50.DOSmoothRewind(UnityEngine.Audio.AudioMixer)">
<summary> <summary>
Smoothly eewinds all tweens that have this target as a reference 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) (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. and returns the total number of tweens rewinded.
</summary> </summary>

View File

@ -790,6 +790,10 @@
<member name="M:DG.Tweening.TweenExtensions.IsPlaying(DG.Tweening.Tween)"> <member name="M:DG.Tweening.TweenExtensions.IsPlaying(DG.Tweening.Tween)">
<summary>Returns TRUE if this tween is playing</summary> <summary>Returns TRUE if this tween is playing</summary>
</member> </member>
<member name="M:DG.Tweening.TweenExtensions.Loops(DG.Tweening.Tween)">
<summary>Returns the total number of loops set for this tween
(returns -1 if the loops are infinite)</summary>
</member>
<member name="M:DG.Tweening.TweenExtensions.PathGetPoint(DG.Tweening.Tween,System.Single)"> <member name="M:DG.Tweening.TweenExtensions.PathGetPoint(DG.Tweening.Tween,System.Single)">
<summary> <summary>
Returns a point on a path based on the given path percentage. Returns a point on a path based on the given path percentage.

View File

@ -94,7 +94,7 @@
</member> </member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOSmoothRewind(UnityEngine.Audio.AudioMixer)"> <member name="M:DG.Tweening.ShortcutExtensions50.DOSmoothRewind(UnityEngine.Audio.AudioMixer)">
<summary> <summary>
Smoothly eewinds all tweens that have this target as a reference 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) (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. and returns the total number of tweens rewinded.
</summary> </summary>

View File

@ -790,6 +790,10 @@
<member name="M:DG.Tweening.TweenExtensions.IsPlaying(DG.Tweening.Tween)"> <member name="M:DG.Tweening.TweenExtensions.IsPlaying(DG.Tweening.Tween)">
<summary>Returns TRUE if this tween is playing</summary> <summary>Returns TRUE if this tween is playing</summary>
</member> </member>
<member name="M:DG.Tweening.TweenExtensions.Loops(DG.Tweening.Tween)">
<summary>Returns the total number of loops set for this tween
(returns -1 if the loops are infinite)</summary>
</member>
<member name="M:DG.Tweening.TweenExtensions.PathGetPoint(DG.Tweening.Tween,System.Single)"> <member name="M:DG.Tweening.TweenExtensions.PathGetPoint(DG.Tweening.Tween,System.Single)">
<summary> <summary>
Returns a point on a path based on the given path percentage. Returns a point on a path based on the given path percentage.

View File

@ -94,7 +94,7 @@
</member> </member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOSmoothRewind(UnityEngine.Audio.AudioMixer)"> <member name="M:DG.Tweening.ShortcutExtensions50.DOSmoothRewind(UnityEngine.Audio.AudioMixer)">
<summary> <summary>
Smoothly eewinds all tweens that have this target as a reference 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) (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. and returns the total number of tweens rewinded.
</summary> </summary>

View File

@ -0,0 +1,25 @@
using UnityEngine;
using System.Collections;
using DG.Tweening;
public class PressPlatform : MonoBehaviour
{
public float speed = 2;
Tweener tween;
void Start()
{
// Create the tween
tween = transform.DOLocalMoveY(-4, speed).SetAutoKill(false).Pause();
}
void Update()
{
if (Input.GetKeyDown(KeyCode.DownArrow)) {
tween.PlayForward();
} else if (Input.GetKeyUp(KeyCode.DownArrow)) {
tween.PlayBackwards();
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 9d358361257181d4a9f560c14c0e58ca
timeCreated: 1433544002
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0394305039ec6eb48b4883a3274922cb
timeCreated: 1433543602
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6274db3b7de32fd48850882fdcc7b4ab
timeCreated: 1433414690
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,34 @@
using System;
using System.Text;
using UnityEngine;
using System.Collections;
public class RectTransformConversionTests : BrainBase
{
public RectTransform a, b;
public RectTransform target;
void Start()
{
// Corners
Vector3[] aCorners = new Vector3[4];
Vector3[] targetCorners = new Vector3[4];
a.GetWorldCorners(aCorners);
target.GetWorldCorners(targetCorners);
Debug.Log("A ::::::::::::::::::::::::::::::::::::::");
Debug.Log("Corners: " + ArrayToString(aCorners));
Debug.Log("B ::::::::::::::::::::::::::::::::::::::");
Debug.Log("TARGET :::::::::::::::::::::::::::::::::");
Debug.Log("Corners: " + ArrayToString(targetCorners));
}
string ArrayToString(IList list)
{
StringBuilder s = new StringBuilder();
for (int i = 0; i < list.Count; ++i) {
if (i > 0) s.Append(", ");
s.Append(list[i].ToString());
}
return s.ToString();
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 4f9a8d2e22a0f3f4d84e1d1f32d005a7
timeCreated: 1433409273
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 67d34f8f14b3dfa409be463f5b66239d
timeCreated: 1433409263
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -32,7 +32,7 @@ namespace DG.Tweening
public class DOTween public class DOTween
{ {
/// <summary>DOTween's version</summary> /// <summary>DOTween's version</summary>
public static readonly string Version = "1.0.775"; public static readonly string Version = "1.0.780";
/////////////////////////////////////////////// ///////////////////////////////////////////////
// Options //////////////////////////////////// // Options ////////////////////////////////////

View File

@ -508,6 +508,18 @@ namespace DG.Tweening
return t.isPlaying; return t.isPlaying;
} }
/// <summary>Returns the total number of loops set for this tween
/// (returns -1 if the loops are infinite)</summary>
public static int Loops(this Tween t)
{
if (!t.active) {
if (Debugger.logPriority > 0) Debugger.LogInvalidTween(t);
return 0;
}
return t.loops;
}
#region Path Tweens #region Path Tweens
/// <summary> /// <summary>

View File

@ -790,6 +790,10 @@
<member name="M:DG.Tweening.TweenExtensions.IsPlaying(DG.Tweening.Tween)"> <member name="M:DG.Tweening.TweenExtensions.IsPlaying(DG.Tweening.Tween)">
<summary>Returns TRUE if this tween is playing</summary> <summary>Returns TRUE if this tween is playing</summary>
</member> </member>
<member name="M:DG.Tweening.TweenExtensions.Loops(DG.Tweening.Tween)">
<summary>Returns the total number of loops set for this tween
(returns -1 if the loops are infinite)</summary>
</member>
<member name="M:DG.Tweening.TweenExtensions.PathGetPoint(DG.Tweening.Tween,System.Single)"> <member name="M:DG.Tweening.TweenExtensions.PathGetPoint(DG.Tweening.Tween,System.Single)">
<summary> <summary>
Returns a point on a path based on the given path percentage. Returns a point on a path based on the given path percentage.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -94,7 +94,7 @@
</member> </member>
<member name="M:DG.Tweening.ShortcutExtensions50.DOSmoothRewind(UnityEngine.Audio.AudioMixer)"> <member name="M:DG.Tweening.ShortcutExtensions50.DOSmoothRewind(UnityEngine.Audio.AudioMixer)">
<summary> <summary>
Smoothly eewinds all tweens that have this target as a reference 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) (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. and returns the total number of tweens rewinded.
</summary> </summary>